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'));
 }
Example #2
0
 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'));
 }
Example #3
0
 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'));
 }
 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'))));
 }
Example #5
0
 /**
  *  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'));
 }
 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);
     }
 }
 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',
     // ));
 }
Example #8
0
 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'));
 }
Example #9
0
 /**
  * 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'))));
 }
 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'))));
 }
Example #11
0
 /**
  * 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'));
 }
 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'))));
 }
 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))));
 }
 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'));
 }
 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'));
 }
 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' => __('Image Field Class', 'acf-image_area_selection'), 'instructions' => __('Class of the image field you want to select the area from.', 'acf-image_area_selection'), 'type' => 'text', 'name' => 'image_field_class'));
 }
 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' => __('Column Count', 'acf-column'), 'instructions' => __('At the end of the row add a column reset.', 'acf-column'), 'type' => 'select', 'name' => 'column-type', 'class' => 'column-type-select', 'choices' => array('1_1' => __('Reset', 'acf-column'), '1_2' => __('One Half', 'acf-column'), '1_3' => __('One Third', 'acf-column'), '2_3' => __('Two Thirds', 'acf-column'), '1_4' => __('One Quarter', 'acf-column'), '3_4' => __('Three Quarters', 'acf-column'), '1_5' => __('One Fifth', 'acf-column'), '2_5' => __('Two Fifth', 'acf-column'), '3_5' => __('Three Fifth', 'acf-column'), '4_5' => __('Four Fifth', 'acf-column'), '1_6' => __('One Sixth', 'acf-column'), '1_8' => __('One Eighth', 'acf-column'))));
 }
 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' => __('Default Icon', 'acf-icon_font'), 'instructions' => '', 'type' => 'select', 'name' => 'default_icon', 'class' => 'el-line', 'choices' => $this->iconNames));
 }
 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' => __('Icon Selector', 'acf-icon_field'), 'instructions' => __('Select an icon from the custom set included with this theme', 'acf-icon_field'), 'type' => 'radio', 'name' => 'icon_field'));
 }
    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'			=> __('Icon class','acf-accordion'),
        // 	'instructions'	=> __('You can add any icon class from the <a href="https://developer.wordpress.org/resource/dashicons/" target="_blank">Developer Resources: Dashicons</a>','acf-accordion'),
        // 	'type'			=> 'text',
        // 	'name'			=> 'icon_class',
        // ));
        $json_file = wp_remote_get($this->settings['icons']);
        $json_file = wp_remote_retrieve_body($json_file);
        $json_content = @json_decode($json_file, true);
        if (!isset($json_content['icons'])) {
            _e('No icons found', 'acf-accordion');
            return;
        }
        $icons = array();
        foreach ($json_content['icons'] as $icon) {
            $icons[$icon['icon']['class']] = $icon['icon']['name'];
        }
        acf_render_field_setting($field, array('label' => __('Icon', 'acf-accordion'), 'type' => 'select', 'id' => $field['ID'] . 'accordion-select', 'name' => 'icon_class', 'choices' => $icons));
        ?>
		<script>
			(function($){				
				var ID = '<?php 
        echo $field['ID'];
        ?>
';
				jQuery("#"+ID+"accordion-select").select2({
					formatResult: format,
					formatSelection: format,
				});
				function format(o) {
					if (!o.id) {
						return o.text; // optgroup
					} else {
						return "<i class='accordion dashicons " + o.id + "' style='margin-right: 5px;'></i>" + o.text;
					}
				}
			})(jQuery);
		</script>
		<?php 
    }
Example #21
0
 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' => __('Default Value', 'acf-hidden'), 'instructions' => __('Set a default value for the field', 'acf-hidden'), 'type' => 'string', 'name' => 'default_value', 'prepend' => ''));
     acf_render_field_setting($field, array('label' => __('Adhere to default value changes', 'acf-hidden'), 'instructions' => __('If the default value should always be used.', 'acf-hidden'), 'type' => 'radio', 'name' => 'return_default_value', 'choices' => array('yes' => 'Yes', 'no' => 'No'), 'default_value' => 'yes', 'prepend' => ''));
 }
Example #22
0
 public 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, ['label' => __('Language', 'acf-code'), 'instructions' => __('Language to use for highlighting.', 'acf-code'), 'type' => 'select', 'name' => 'language', 'choices' => ['abap' => __('ABAP', 'acf-code'), 'abc' => __('ABC', 'acf-code'), 'actionscript' => __('ActionScript', 'acf-code'), 'ada' => __('ADA', 'acf-code'), 'apache_conf' => __('Apache Conf', 'acf-code'), 'asciidoc' => __('AsciiDoc', 'acf-code'), 'assembly_x86' => __('Assembly x86', 'acf-code'), 'autohotkey' => __('AutoHotKey', 'acf-code'), 'batchfile' => __('BatchFile', 'acf-code'), 'c9search' => __('C9Search', 'acf-code'), 'c_cpp' => __('C and C++', 'acf-code'), 'cirru' => __('Cirru', 'acf-code'), 'clojure' => __('Clojure', 'acf-code'), 'cobol' => __('Cobol', 'acf-code'), 'coffee' => __('CoffeeScript', 'acf-code'), 'coldfusion' => __('ColdFusion', 'acf-code'), 'csharp' => __('C#', 'acf-code'), 'css' => __('CSS', 'acf-code'), 'curly' => __('Curly', 'acf-code'), 'd' => __('D', 'acf-code'), 'dart' => __('Dart', 'acf-code'), 'diff' => __('Diff', 'acf-code'), 'dockerfile' => __('Dockerfile', 'acf-code'), 'dot' => __('Dot', 'acf-code'), 'dummy' => __('Dummy', 'acf-code'), 'dummysyntax' => __('DummySyntax', 'acf-code'), 'eiffel' => __('Eiffel', 'acf-code'), 'ejs' => __('EJS', 'acf-code'), 'elixir' => __('Elixir', 'acf-code'), 'elm' => __('Elm', 'acf-code'), 'erlang' => __('Erlang', 'acf-code'), 'forth' => __('Forth', 'acf-code'), 'ftl' => __('FreeMarker', 'acf-code'), 'gcode' => __('Gcode', 'acf-code'), 'gherkin' => __('Gherkin', 'acf-code'), 'gitignore' => __('Gitignore', 'acf-code'), 'glsl' => __('Glsl', 'acf-code'), 'golang' => __('Go', 'acf-code'), 'groovy' => __('Groovy', 'acf-code'), 'haml' => __('HAML', 'acf-code'), 'handlebars' => __('Handlebars', 'acf-code'), 'haskell' => __('Haskell', 'acf-code'), 'haxe' => __('haXe', 'acf-code'), 'html' => __('HTML', 'acf-code'), 'html_ruby' => __('HTML (Ruby)', 'acf-code'), 'ini' => __('INI', 'acf-code'), 'io' => __('Io', 'acf-code'), 'jack' => __('Jack', 'acf-code'), 'jade' => __('Jade', 'acf-code'), 'java' => __('Java', 'acf-code'), 'javascript' => __('JavaScript', 'acf-code'), 'json' => __('JSON', 'acf-code'), 'jsoniq' => __('JSONiq', 'acf-code'), 'jsp' => __('JSP', 'acf-code'), 'jsx' => __('JSX', 'acf-code'), 'julia' => __('Julia', 'acf-code'), 'latex' => __('LaTeX', 'acf-code'), 'lean' => __('Lean', 'acf-code'), 'less' => __('LESS', 'acf-code'), 'liquid' => __('Liquid', 'acf-code'), 'lisp' => __('Lisp', 'acf-code'), 'livescript' => __('LiveScript', 'acf-code'), 'logiql' => __('LogiQL', 'acf-code'), 'lsl' => __('LSL', 'acf-code'), 'lua' => __('Lua', 'acf-code'), 'luapage' => __('LuaPage', 'acf-code'), 'lucene' => __('Lucene', 'acf-code'), 'makefile' => __('Makefile', 'acf-code'), 'markdown' => __('Markdown', 'acf-code'), 'mask' => __('Mask', 'acf-code'), 'matlab' => __('MATLAB', 'acf-code'), 'mel' => __('MEL', 'acf-code'), 'mushcode' => __('MUSHCode', 'acf-code'), 'mysql' => __('MySQL', 'acf-code'), 'nix' => __('Nix', 'acf-code'), 'objectivec' => __('Objective-C', 'acf-code'), 'ocaml' => __('OCaml', 'acf-code'), 'pascal' => __('Pascal', 'acf-code'), 'perl' => __('Perl', 'acf-code'), 'pgsql' => __('pgSQL', 'acf-code'), 'php' => __('PHP', 'acf-code'), 'powershell' => __('Powershell', 'acf-code'), 'praat' => __('Praat', 'acf-code'), 'prolog' => __('Prolog', 'acf-code'), 'properties' => __('Properties', 'acf-code'), 'protobuf' => __('Protobuf', 'acf-code'), 'python' => __('Python', 'acf-code'), 'r' => __('R', 'acf-code'), 'rdoc' => __('RDoc', 'acf-code'), 'rhtml' => __('RHTML', 'acf-code'), 'ruby' => __('Ruby', 'acf-code'), 'rust' => __('Rust', 'acf-code'), 'sass' => __('SASS', 'acf-code'), 'scad' => __('SCAD', 'acf-code'), 'scala' => __('Scala', 'acf-code'), 'scheme' => __('Scheme', 'acf-code'), 'scss' => __('SCSS', 'acf-code'), 'sh' => __('SH', 'acf-code'), 'sjs' => __('SJS', 'acf-code'), 'smarty' => __('Smarty', 'acf-code'), 'snippets' => __('snippets', 'acf-code'), 'soy_template' => __('Soy Template', 'acf-code'), 'space' => __('Space', 'acf-code'), 'sql' => __('SQL', 'acf-code'), 'stylus' => __('Stylus', 'acf-code'), 'svg' => __('SVG', 'acf-code'), 'tcl' => __('Tcl', 'acf-code'), 'tex' => __('Tex', 'acf-code'), 'text' => __('Text', 'acf-code'), 'textile' => __('Textile', 'acf-code'), 'toml' => __('Toml', 'acf-code'), 'twig' => __('Twig', 'acf-code'), 'typescript' => __('Typescript', 'acf-code'), 'vala' => __('Vala', 'acf-code'), 'vbscript' => __('VBScript', 'acf-code'), 'velocity' => __('Velocity', 'acf-code'), 'verilog' => __('Verilog', 'acf-code'), 'vhdl' => __('VHDL', 'acf-code'), 'xml' => __('XML', 'acf-code'), 'xquery' => __('XQuery', 'acf-code'), 'yaml' => __('YAML', 'acf-code'), 'django' => __('Django', 'acf-code')]]);
     acf_render_field_setting($field, ['label' => __('Theme', 'acf-code'), 'instructions' => __('Theme to use for highlighting.', 'acf-code'), 'type' => 'select', 'name' => 'theme', 'choices' => [__('Bright', 'acf-code') => ['chrome' => __('Chrome', 'acf-code'), 'clouds' => __('Clouds', 'acf-code'), 'crimson_editor' => __('Crimson Editor', 'acf-code'), 'dawn' => __('Dawn', 'acf-code'), 'dreamweaver' => __('Dreamweaver', 'acf-code'), 'eclipse' => __('Eclipse', 'acf-code'), 'github' => __('GitHub', 'acf-code'), 'solarized_light' => __('Solarized Light', 'acf-code'), 'textmate' => __('TextMate', 'acf-code'), 'tomorrow' => __('Tomorrow', 'acf-code'), 'xcode' => __('XCode', 'acf-code'), 'kuroir' => __('Kuroir', 'acf-code'), 'katzenmilch' => __('KatzenMilch', 'acf-code')], __('Dark', 'acf-code') => ['ambiance' => __('Ambiance', 'acf-code'), 'chaos' => __('Chaos', 'acf-code'), 'clouds_midnight' => __('Clouds Midnight', 'acf-code'), 'cobalt' => __('Cobalt', 'acf-code'), 'idle_fingers' => __('idle Fingers', 'acf-code'), 'kr_theme' => __('krTheme', 'acf-code'), 'merbivore' => __('Merbivore', 'acf-code'), 'merbivore_soft' => __('Merbivore Soft', 'acf-code'), 'mono_industrial' => __('Mono Industrial', 'acf-code'), 'monokai' => __('Monokai', 'acf-code'), 'pastel_on_dark' => __('Pastel on dark', 'acf-code'), 'solarized_dark' => __('Solarized Dark', 'acf-code'), 'terminal' => __('Terminal', 'acf-code'), 'tomorrow_night' => __('Tomorrow Night', 'acf-code'), 'tomorrow_night_blue' => __('Tomorrow Night Blue', 'acf-code'), 'tomorrow_night_bright' => __('Tomorrow Night Bright', 'acf-code'), 'tomorrow_night_eighties' => __('Tomorrow Night 80s', 'acf-code'), 'twilight' => __('Twilight', 'acf-code'), 'vibrant_ink' => __('Vibrant Ink', 'acf-code')]]]);
 }
 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' => __('Filter name used for population', 'acf-populated-select'), 'instructions' => __('if set to "my_filter", you could later populate the field with add_filter("my_filter", "some_fancy_function");', 'acf-populated-select'), 'type' => 'text', 'name' => 'filter_name'));
     acf_render_field_setting($field, array('label' => __('Allow multiple values', 'acf-populated-select'), 'type' => 'radio', 'choices' => [false => 'No', true => 'Yes'], 'name' => 'multiple'));
 }
 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' => __('Site Key', 'acf-recaptcha'), 'instructions' => __('Enter your site key from Google reCAPTCHA.', 'acf-recaptcha'), 'name' => 'site_key', 'required' => true));
     acf_render_field_setting($field, array('label' => __('Secret Key', 'acf-recaptcha'), 'instructions' => __('Enter your secret key from Google reCAPTCHA.', 'acf-recaptcha'), 'name' => 'secret_key', 'required' => true));
 }
 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' => __('Prefix', 'acf-auto_generated_value'), 'instructions' => __('Set the prefix of the generated key', 'acf-auto_generated_value'), 'type' => 'text', 'name' => 'value_prefix'));
     acf_render_field_setting($field, array('label' => __('Hide', 'acf-auto_generated_value'), 'instructions' => __('Hide the field from the user', 'acf-auto_generated_value'), 'type' => 'radio', 'layout' => 'horizontal', 'name' => 'hide', 'choices' => array('yes' => 'Yes', 'no' => 'No')));
 }
 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' => __('Character number', 'acf-limiter'), 'instructions' => __('How many characters would you like to limit', 'acf-limiter'), 'type' => 'number', 'name' => 'character_number', 'append' => 'characters'));
     acf_render_field_setting($field, array('label' => 'Display character limit', 'instructions' => __('Show the number of characters left over the top of the progress bar.', 'acf-limiter'), 'type' => 'radio', 'name' => 'display_characters', 'choices' => array(1 => __("No", 'acf'), 0 => __("Yes", 'acf')), 'layout' => 'horizontal'));
 }
Example #27
0
 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' => __('Start Year', 'acf-year'), 'instructions' => __('The starting year to display in the select element when submitting data', 'acf-year'), 'type' => 'text', 'name' => 'startYear', 'prepend' => ''));
     acf_render_field_setting($field, array('label' => __('Year Range', 'acf-year'), 'instructions' => __('The range of years that are displayed when submitting data', 'acf-year'), 'type' => 'text', 'name' => 'yearRange', 'prepend' => ''));
 }
 /**
  * render_field_settings()
  *
  * Create extra settings for your field. These are visible when editing a field
  *
  * @type  action
  * @since 3.6
  * @date  23/01/13
  *
  * @param  $field (array) the $field being edited
  * @return n/a
  */
 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' => 'Allow Null?', 'type' => 'radio', 'name' => 'allow_null', 'choices' => array(1 => __('Yes', 'acf'), 0 => __('No', 'acf')), 'layout' => 'horizontal'));
     acf_render_field_setting($field, array('label' => 'Allow Multiple?', 'type' => 'radio', 'name' => 'allow_multiple', 'choices' => array(1 => __('Yes', 'acf'), 0 => __('No', 'acf')), 'layout' => 'horizontal'));
 }
 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' => __('Custom CSS', 'acf-divider'), 'type' => 'textarea', 'name' => 'custom_css'));
     acf_render_field_setting($field, array('label' => __('Instructions', 'acf-divider'), 'instructions' => __('Divide field groups', 'acf-divider'), 'type' => 'message', 'message' => 'Use "Field Divider" to better organize your edit screen by grouping fields together.'));
 }
 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('required' => true, 'label' => __('Client Id', 'acf-instagram'), 'instructions' => __('Create an Instagram app and get your credentials at: ', 'acf-instagram') . ' <a href="http://instagram.com/developer/">http://instagram.com/developer/</a>', 'type' => 'text', 'name' => 'client_id'));
     acf_render_field_setting($field, array('required' => true, 'label' => __('Client Secret', 'acf-instagram'), 'type' => 'text', 'name' => 'client_secret'));
     acf_render_field_setting($field, array('required' => true, 'label' => __('Cache lifetime', 'acf-instagram'), 'instructions' => __('Number of seconds before we try to fetch the media info again', 'acf-instagram'), 'default_value' => '900', 'min' => 0, 'max' => 1000000, 'type' => 'number', 'append' => 'sec.', 'name' => 'cache_lifetime'));
 }