name = 'wpml_language_selector'; $this->label = 'WPML Language Selector'; $this->category = __("Choice",'acf'); // Basic, Content, Choice, etc $this->defaults = array( // add default here to merge into your field. // This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg: //'preview_size' => 'thumbnail' ); // do not delete! parent::__construct(); // settings $this->settings = array( 'path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'version' => '1.0.0' ); } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like below) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // defaults? /* $field = array_merge($this->defaults, $field); */ // key is needed in the field names to correctly save the data $key = $field['name']; $value = isset($field['type_of_selector']) ? $field['type_of_selector'] : ''; // Create Field Options HTML ?>

'select', 'name' => 'fields['.$key.'][type_of_selector]', 'value' => $value, 'layout' => 'horizontal', 'choices' => array( 'select' => __('Select', 'acf-wpml_language_selector'), 'radio' => __('Radio Button', 'acf-wpml_language_selector'), 'checkbox' => __('Checkbox (multiple select)', 'acf-wpml_language_selector') ) )); ?>