name = 'button'; $this->label = __('Button'); $this->category = __("Basic",'acf'); // Basic, Content, Choice, etc $this->defaults = array(); // 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 bellow) 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']; // Create Field Options HTML } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { $field = array_merge($this->defaults, $field); $field_name = esc_attr( $field['name'] ); $use_internal = $field['value']['use_internal'] === 'false' ? false : true; $external_class = $use_internal ? 'hidden' : null; $internal_class = $use_internal ? null : 'hidden'; $switch_text = $use_internal ? 'external' : 'internal'; ?>
| 'post_object', 'name' => $field_name . '[page_id]', 'value' => $field['value']['page_id'] )); ?> | ||