PHP Class RWMB_Taxonomy_Field

Inheritance: extends RWMB_Field
Show file Open project: rilwis/meta-box Class Usage Examples

Public Methods

Method Description
get_db_fields ( ) : array Get field names of object to be used by walker
get_option_label ( array $field, string $value ) : string Get option label
get_options ( array $field ) : array Get options for selects, checkbox list, etc via the terms
get_value ( array $field, array $args = [], integer | null $post_id = null ) : array Get the field value Return list of post term objects
normalize ( $field ) : array Add default value for 'taxonomy' field
raw_meta ( integer $post_id, array $field ) : mixed Get raw meta value
save ( mixed $new, mixed $old, integer $post_id, array $field ) Save meta value

Method Details

get_db_fields() public static method

Get field names of object to be used by walker
public static get_db_fields ( ) : array
return array

get_option_label() public static method

Get option label
public static get_option_label ( array $field, string $value ) : string
$field array Field parameter
$value string Option value
return string

get_options() public static method

Get options for selects, checkbox list, etc via the terms
public static get_options ( array $field ) : array
$field array Field parameters
return array

get_value() public static method

Get the field value Return list of post term objects
public static get_value ( array $field, array $args = [], integer | null $post_id = null ) : array
$field array Field parameters
$args array Additional arguments. Rarely used. See specific fields for details
$post_id integer | null Post ID. null for current post. Optional.
return array List of post term objects

normalize() public static method

Add default value for 'taxonomy' field
public static normalize ( $field ) : array
$field
return array

raw_meta() public static method

Get raw meta value
public static raw_meta ( integer $post_id, array $field ) : mixed
$post_id integer
$field array
return mixed

save() public static method

Save meta value
public static save ( mixed $new, mixed $old, integer $post_id, array $field )
$new mixed
$old mixed
$post_id integer
$field array