name = 'sidebar_selector'; $this->label = __( 'Sidebar Selector', 'acf-sidebar-selector-field' ); $this->category = __( "Choice",'acf' ); $this->defaults = array( 'allow_null' => '1', 'default_value' => '' ); parent::__construct(); $this->settings = array( 'path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'version' => '1.0.0' ); } /** * Field Options * * Creates the options for the field, they are shown when the user * creates a field in the back-end. Currently there are two fields. * * Allowing null determines if the user is allowed to select no sidebars * * The default value can set the dropdown to a pre-set value when loaded * * @param array $field The details of this field * @author Daniel Pataki * @since 3.0.0 * */ function create_options($field) { $field = array_merge($this->defaults, $field); $key = $field['name']; ?> 'radio', 'name' => 'fields[' . $key . '][allow_null]', 'value' => $field['allow_null'], 'layout' => 'horizontal', 'choices' => array( '1' => __('Yes', 'acf'), '0' => __('No', 'acf'), ) )); ?> 'text', 'name' => 'fields[' . $key . '][default_value]', 'value' => $field['default_value'], )); ?>