name = 'page_link'; $this->label = __("Page Link",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'post_type' => array('all'), 'multiple' => 0, 'allow_null' => 0, ); // do not delete! parent::__construct(); } /* * load_field() * * This filter is appied to the $field after it is loaded from the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * * @return $field - the field array holding all the field options */ function load_field( $field ) { // validate post_type if( !$field['post_type'] || !is_array($field['post_type']) || in_array('', $field['post_type']) ) { $field['post_type'] = array( 'all' ); } // return return $field; } /* * 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 ) { // let post_object create the field $field['type'] = 'post_object'; do_action('acf/create_field', $field ); } /* * 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 ) { $key = $field['name']; ?>