本文整理汇总了PHP中acf_render_field_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP acf_render_field_setting函数的具体用法?PHP acf_render_field_setting怎么用?PHP acf_render_field_setting使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acf_render_field_setting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_field_settings
function render_field_settings($field)
{
// Add option to select taxonomy used for field
acf_render_field_setting($field, array('label' => __('User Taxonomy', 'acf'), 'instructions' => __('Select the taxonomy to be displayed', 'acf'), 'type' => 'select', 'name' => 'taxonomy', 'choices' => acf_get_taxonomies()));
// Allow field to not be set.
acf_render_field_setting($field, array('label' => __('Allow Null', 'acf'), 'instructions' => '', 'type' => 'true_false', 'name' => 'allow_null'));
}
示例2: render_field_settings
function render_field_settings($field)
{
// default_value
acf_render_field_setting($field, array('label' => __('Message', 'acf'), 'instructions' => __('Please note that all text will first be passed through the wp function ', 'acf') . '<a href="http://codex.wordpress.org/Function_Reference/wpautop" target="_blank">wpautop()</a>', 'type' => 'textarea', 'name' => 'message'));
// HTML
acf_render_field_setting($field, array('label' => __('Escape HTML', 'acf'), 'instructions' => __('Allow HTML markup to display as visible text instead of rendering', 'acf'), 'type' => 'radio', 'name' => 'esc_html', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'));
}
示例3: render_field_settings
function render_field_settings($field)
{
// message
acf_render_field_setting($field, array('label' => __('Message', 'acf'), 'instructions' => __('eg. Show extra content', 'acf'), 'type' => 'text', 'name' => 'message'));
// default_value
acf_render_field_setting($field, array('label' => __('Default Value', 'acf'), 'instructions' => '', 'type' => 'true_false', 'name' => 'default_value'));
}
示例4: render_field_settings
function render_field_settings($field)
{
// Message
acf_render_field_setting($field, array('label' => __('Message', 'acf'), 'instructions' => __('Works like the default Message field but supports PHP and without ', 'acf') . '<a href="http://codex.wordpress.org/Function_Reference/wpautop" target="_blank">wpautop()</a>', 'type' => 'textarea', 'name' => 'enhanced_message'));
// Hide Label?
acf_render_field_setting($field, array('label' => __('Hide Label', 'acf'), 'type' => 'radio', 'name' => 'hide_label', 'layout' => 'horizontal', 'choices' => array('yes' => __('Yes'), 'no' => __('No'))));
}
示例5: render_field_settings
/**
* Create extra settings for your field. These are visible when editing a field
*
* @param $field (array) the $field being edited
* @return n/a
*/
function render_field_settings($field)
{
$field = array_merge($this->defaults, $field);
$key = $field['name'];
acf_render_field_setting($field, array('label' => __("Allow Null?", 'acf'), 'type' => 'radio', 'name' => 'allow_null', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'));
acf_render_field_setting($field, array('label' => __("Display Widget Area HTML or Return Widget Area Name", 'acf_widget_area'), 'type' => 'radio', 'name' => 'display_or_return', 'choices' => array('display' => __("Display Widget Area HTML", 'acf_widget_area'), 'return' => __("Return Widget Name", 'acf_widget_area')), 'layout' => 'horizontal'));
}
示例6: render_field_settings
function render_field_settings($field)
{
$field_settings_params = array(array('label' => 'Allow Null?', 'type' => 'radio', 'name' => 'allow_null', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'), array('label' => __('Return Format', 'acf-tablepress'), 'instructions' => '', 'type' => 'radio', 'name' => 'return_format', 'choices' => array('table_id' => __("Table ID - Output only the Table ID Number", 'acf-tablepress'), 'rendered_html' => __("HTML - Output the rendered HTML of the table itself. Equivalent to do_shortcode(), but does not use that function.", 'acf-tablepress')), 'layout' => 'vertical'));
foreach ($field_settings_params as $field_settings) {
acf_render_field_setting($field, $field_settings);
}
}
示例7: render_field_settings
function render_field_settings($field)
{
/*
* acf_render_field_setting
*
* This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
* The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
*
* More than one setting can be added by copy/paste the above code.
* Please note that you must also have a matching $defaults value for the field name (font_size)
*/
// choices : Term or Taxonomy
acf_render_field_setting($field, array('label' => __('Select Type', 'taxonomy-chooser'), 'instructions' => '', 'type' => 'select', 'name' => 'tax_type', 'choices' => array(1 => __("Taxonomy", 'taxonomy-chooser'), 0 => __("Term", 'taxonomy-chooser')), 'layout' => 'horizontal'));
// choices : Allowed Taxonomies
acf_render_field_setting($field, array('label' => __('Choose Allowed Taxonomies', 'taxonomy-chooser'), 'instructions' => '', 'type' => 'select', 'name' => 'choices', 'choices' => acf_get_pretty_taxonomies(), 'multiple' => 1, 'ui' => 1, 'allow_null' => 1, 'placeholder' => __("All Taxonomies", 'taxonomy-chooser')));
// term id or slug
acf_render_field_setting($field, array('label' => __('Return Term Value', 'taxonomy-chooser'), 'instructions' => __('Specify the returned value on front end (taxonomies always return as slug)', 'taxonomy-chooser'), 'type' => 'radio', 'name' => 'type_value', 'choices' => array(1 => __("ID", 'taxonomy-chooser'), 0 => __("Slug", 'taxonomy-chooser')), 'layout' => 'horizontal'));
// multiple
// acf_render_field_setting( $field, array(
// 'label' => __('Select multiple values?','taxonomy-chooser'),
// 'instructions' => '',
// 'type' => 'radio',
// 'name' => 'multiple',
// 'choices' => array(
// 1 => __("Yes",'taxonomy-chooser'),
// 0 => __("No",'taxonomy-chooser'),
// ),
// 'layout' => 'horizontal',
// ));
}
示例8: render_field_settings
function render_field_settings($field)
{
/*
* acf_render_field_setting
*
* This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
* The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
*
* More than one setting can be added by copy/paste the above code.
* Please note that you must also have a matching $defaults value for the field name (font_size)
*/
// vars
$key = $field['name'];
// implode checkboxes so they work in a textarea
if (is_array($field['choices'])) {
foreach ($field['choices'] as $k => $v) {
$field['choices'][$k] = $k . ' : ' . $v;
}
$field['choices'] = implode("\n", $field['choices']);
}
acf_render_field_setting($field, array('label' => __('Choices', 'acf-image_select'), 'instructions' => __('Enter your choices one per line <br /> Red <br /> Blue <br /> red : Red <br /> blue : Blue <br /><span style="color:#BC0B0B">Please note:</span> The first value of each choices will used as name of image.<br />Like for "<strong>Blue</strong>" or "<strong>blue : Blue</strong>", the image name will be "<strong>blue.png</strong>"', 'acf-image_select'), 'type' => 'textarea', 'name' => 'choices'));
acf_render_field_setting($field, array('label' => __('Default Value', 'acf-image_select'), 'type' => 'text', 'name' => 'default_value'));
acf_render_field_setting($field, array('label' => __('Allow Multiple Choices?', 'acf-image_select'), 'type' => 'radio', 'choices' => array(1 => __("Yes", 'image_select'), 0 => __("No", 'image_select')), 'layout' => 'horizontal', 'name' => 'multiple'));
acf_render_field_setting($field, array('label' => __('Image Path', 'acf-image_select'), 'instructions' => __('Enter folder URL for images <b>based on current theme</b>.', 'acf-image_select'), 'type' => 'text', 'name' => 'image_path'));
acf_render_field_setting($field, array('label' => __('Image Extension', 'acf-image_select'), 'type' => 'text', 'name' => 'image_extension'));
}
示例9: render_field_settings
/**
* Renders the Nav Menu Field options seen when editing a Nav Menu Field.
*
* @param array $field The array representation of the current Nav Menu Field.
*/
public function render_field_settings($field)
{
// Register the Return Value format setting
acf_render_field_setting($field, array('label' => __('Return Value'), 'instructions' => __('Specify the returned value on front end'), 'type' => 'radio', 'name' => 'save_format', 'layout' => 'horizontal', 'choices' => array('object' => __('Nav Menu Object'), 'menu' => __('Nav Menu HTML'), 'id' => __('Nav Menu ID'))));
// Register the Menu Container setting
acf_render_field_setting($field, array('label' => __('Menu Container'), 'instructions' => __("What to wrap the Menu's ul with (when returning HTML only)"), 'type' => 'select', 'name' => 'container', 'choices' => $this->get_allowed_nav_container_tags()));
// Register the Allow Null setting
acf_render_field_setting($field, array('label' => __('Allow Null?'), 'type' => 'radio', 'name' => 'allow_null', 'layout' => 'horizontal', 'choices' => array(1 => __('Yes'), 0 => __('No'))));
}
示例10: render_field_settings
function render_field_settings($field)
{
acf_render_field_setting($field, array('label' => __('Type', 'acf-advanced_taxonomy_selector'), 'type' => 'radio', 'name' => 'data_type', 'choices' => array('terms' => __('Choose Terms', 'acf'), 'taxonomy' => __('Choose Taxonomies', 'acf'))));
acf_render_field_setting($field, array('label' => __('Taxonomies', 'acf-advanced_taxonomy_selector'), 'type' => 'select', 'name' => 'taxonomies', 'multiple' => true, 'choices' => $this->taxonomies_array()));
acf_render_field_setting($field, array('label' => __('Restruct To Post Type', 'acf-advanced_taxonomy_selector'), 'type' => 'select', 'name' => 'post_type', 'multiple' => true, 'choices' => $this->post_types_array()));
acf_render_field_setting($field, array('label' => __('Field Type', 'acf-advanced_taxonomy_selector'), 'type' => 'select', 'name' => 'field_type', 'choices' => array('multiselect' => __('Multiselect', 'acf'), 'select' => __('Select', 'acf'))));
acf_render_field_setting($field, array('label' => __('Allow Null?', 'acf-advanced_taxonomy_selector'), 'type' => 'radio', 'name' => 'allow_null', 'layout' => 'horizontal', 'choices' => array(1 => __('Yes', 'acf'), 0 => __('No', 'acf'))));
acf_render_field_setting($field, array('label' => __('Return Value', 'acf-advanced_taxonomy_selector'), 'type' => 'radio', 'name' => 'return_value', 'choices' => array('term_id' => __('Term ID / Taxonomy Slug', 'acf'), 'object' => __('Term Object / Taxonomy Object', 'acf'))));
}
示例11: render_field_settings
/**
* Create settings for Currency field.
*
* @since 1.1.3
*
* @param array $field The field settings.
*/
function render_field_settings($field)
{
$field['default_value'] = acf_encode_choices($field['default_value']);
// default_value
acf_render_field_setting($field, array('label' => __('Default Value', 'acf'), 'instructions' => __('Choose a default value', 'acf'), 'type' => 'currency', 'name' => 'default_value'));
// allow_null
acf_render_field_setting($field, array('label' => __('Allow Null?', 'acf'), 'instructions' => '', 'type' => 'radio', 'name' => 'allow_null', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'));
// multiple
acf_render_field_setting($field, array('label' => __('Select multiple values?', 'acf'), 'instructions' => '', 'type' => 'radio', 'name' => 'multiple', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'));
}
示例12: render_field_settings
function render_field_settings($field)
{
// default_value
acf_render_field_setting($field, array('label' => __('Default Value', 'acf-wp_wysiwyg'), 'instructions' => __('Appears when creating a new post', 'acf-wp_wysiwyg'), 'type' => 'textarea', 'name' => 'default_value'));
// teeny
acf_render_field_setting($field, array('label' => __('Teeny Mode', 'acf-wp_wysiwyg'), 'instructions' => __('Whether to output the minimal editor configuration used in PressThis', 'acf-wp_wysiwyg'), 'type' => 'radio', 'name' => 'teeny', 'layout' => 'horizontal', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf'))));
// media_upload
acf_render_field_setting($field, array('label' => __('Show Media Upload Buttons?', 'acf'), 'instructions' => '', 'type' => 'radio', 'name' => 'media_buttons', 'layout' => 'horizontal', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf'))));
// media_upload
acf_render_field_setting($field, array('label' => __('Distraction Free Writing', 'acf'), 'instructions' => __('Whether to replace the default fullscreen editor with DFW', 'acf-wp_wysiwyg'), 'instructions' => '', 'type' => 'radio', 'name' => 'dfw', 'layout' => 'horizontal', 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf'))));
}
示例13: render_field_settings
function render_field_settings($field)
{
$field = array_merge($this->defaults, $field);
$key = $field['name'];
acf_render_field_setting($field, array('type' => 'radio', 'label' => __("Date and Time Picker?", $this->domain), 'name' => 'show_date', 'value' => $field['show_date'], 'layout' => 'horizontal', 'choices' => array('true' => __('Date and Time Picker', $this->domain), 'false' => __('Time Picker', $this->domain))));
acf_render_field_setting($field, array('type' => 'text', 'label' => __("Date Format", $this->domain), 'instructions' => sprintf(__("eg. mm/dd/yy. read more about <a href=\"%s\" target=\"_blank\">formatting date</a>", $this->domain), "http://docs.jquery.com/UI/Datepicker/formatDate"), 'name' => 'date_format', 'value' => $field['date_format']));
acf_render_field_setting($field, array('type' => 'text', 'label' => __("Time Format", $this->domain), 'instructions' => sprintf(__("eg. hh:mm. read more about <a href=\"%s\" target=\"_blank\">formatting time</a>", $this->domain), "http://trentrichardson.com/examples/timepicker/#tp-formatting"), 'name' => 'time_format', 'value' => $field['time_format']));
acf_render_field_setting($field, array('type' => 'radio', 'label' => __("Display Week Number?", $this->domain), 'name' => 'show_week_number', 'value' => $field['show_week_number'], 'layout' => 'horizontal', 'choices' => array('true' => __('Yes', $this->domain), 'false' => __('No', $this->domain))));
acf_render_field_setting($field, array('type' => 'radio', 'label' => __("Time Picker style?", $this->domain), 'name' => 'picker', 'value' => $field['picker'], 'layout' => 'horizontal', 'choices' => array('slider' => __('Slider', $this->domain), 'select' => __('Dropdown', $this->domain))));
acf_render_field_setting($field, array('type' => 'radio', 'label' => __("Save as timestamp?", $this->domain), 'instructions' => sprintf(__("Most users should leave this untouched, only set it to \"No\" if you need a date and time format not supported by <a href=\"%s\" target=\"_blank\">strtotime</a>", $this->domain), "http://php.net/manual/en/function.strtotime.php"), 'name' => 'save_as_timestamp', 'value' => $field['save_as_timestamp'], 'layout' => 'horizontal', 'choices' => array('true' => __('Yes', $this->domain), 'false' => __('No', $this->domain))));
acf_render_field_setting($field, array('type' => 'radio', 'label' => __("Get field as timestamp?", $this->domain), 'instructions' => sprintf(__("Most users should leave this untouched, only set it to \"Yes\" if you need get the date and time field as a timestamp using <a href=\"%s\" target=\"_blank\">the_field()</a> or <a href=\"%s\" target=\"_blank\">get_field()</a> ", $this->domain), "http://www.advancedcustomfields.com/resources/functions/the_field/", "http://www.advancedcustomfields.com/resources/functions/get_field/"), 'name' => 'get_as_timestamp', 'value' => $field['get_as_timestamp'], 'layout' => 'horizontal', 'choices' => array('true' => __('Yes', $this->domain), 'false' => __('No', $this->domain))));
}
示例14: render_field_settings
function render_field_settings($field)
{
/*
* acf_render_field_setting
*
* This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
* The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
*
* More than one setting can be added by copy/paste the above code.
* Please note that you must also have a matching $defaults value for the field name (font_size)
*/
acf_render_field_setting($field, array('label' => __('Font Size', 'acf-location'), 'instructions' => __('Customize the input font size', 'acf-location'), 'type' => 'number', 'name' => 'font_size', 'prepend' => 'px'));
}
示例15: render_field_settings
function render_field_settings($field)
{
/*
* acf_render_field_setting
*
* This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
* The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
*
* More than one setting can be added by copy/paste the above code.
* Please note that you must also have a matching $defaults value for the field name (font_size)
*/
acf_render_field_setting($field, array('label' => __('Table Header', 'acf-table'), 'instructions' => __('Presetting the usage of table header', 'acf-table'), 'type' => 'radio', 'name' => 'use_header', 'choices' => array(0 => __("Optional", 'acf-table'), 1 => __("Yes", 'acf-table'), 2 => __("No", 'acf-table')), 'layout' => 'horizontal'));
}