Method |
Description |
|
add_actions ( ) |
Add actions |
|
admin_enqueue_scripts ( ) |
Enqueue scripts and styles |
|
begin_html ( mixed $meta, array $field ) : string |
Show begin HTML markup for fields |
|
call ( ) : mixed |
Call a method of a field. |
|
end_html ( mixed $meta, array $field ) : string |
Show end HTML markup for fields |
|
esc_meta ( mixed $meta ) : mixed |
Escape meta for field output |
|
filter ( ) : mixed |
Apply various filters based on field type, id. |
|
format_single_value ( array $field, string $value ) : string |
Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. |
|
format_value ( array $field, string | array $value ) : string |
Format value for the helper functions. |
|
get_attributes ( array $field, mixed $value = null ) : array |
Get the attributes for a field |
|
get_class_name ( array $field ) : string |
Get field class name |
|
get_value ( array $field, array $args = [], integer | null $post_id = null ) : mixed |
Get the field value
The difference between this function and 'meta' function is 'meta' function always returns the escaped value
of the field saved in the database, while this function returns more meaningful value of the field, for ex.:
for file/image: return array of file/image information instead of file/image IDs |
|
html ( mixed $meta, array $field ) : string |
Get field HTML |
|
localize_script ( string $handle, string $name, mixed $data ) |
Localize scripts with prevention of loading localized data twice. |
|
map_types ( array $field ) : string |
Map types |
|
meta ( integer $post_id, boolean $saved, array $field ) : mixed |
Get meta value |
|
normalize ( array $field ) : array |
Normalize parameters for field |
|
raw_meta ( integer $post_id, array $field ) : mixed |
Get raw meta value |
|
render_attributes ( array $attributes ) : string |
Renders an attribute array into an html attributes string |
|
save ( $new, $old, $post_id, $field ) |
Save meta value |
|
show ( array $field, boolean $saved ) |
Show field HTML
Filters are put inside this method, not inside methods such as "meta", "html", "begin_html", etc. |
|
the_value ( array $field, array $args = [], integer | null $post_id = null ) : string |
Output the field value
Depends on field value and field types, each field can extend this method to output its value in its own way
See specific field classes for details. |
|
value ( mixed $new, mixed $old, integer $post_id, array $field ) : integer |
Set value of meta before saving into database |
|