$version
$version : string
Fluent_Options_Page. Create and stores fields and sections.
__construct(array $args, array $sections) : \none
__construct() parse arguments supplied, setup framework options class.
array | $args | framework setup arguments. Used to change some base settings for the options including context. |
array | $sections | the sections an fields to be used. |
format_option(array $value) : array
Attached to the <code>get_option_{$option_name}</code> filter this function merges the value blueprint with the actual data ensuring all keys are set.
Also uses wp_unslash to remove slashes from values.
array | $value | data supplied from the database. |
load_page(object $page_object) : \none
Fires events on the <code>load_page-{$page-hook}</code> hook point to register/enqueue styles/javascript.
Save the page options. Register metaboxes and screen options. It also adds filters to the metaboxes which help remove the padding applied by WordPress.
object | $page_object | Fluent_Page instance. |
register_field_type(array $field) : \none
Register a field type for use by the framework.
Static interface used so field types can be regsitered at any point, and for any istance of the class.
array | $field | the data to be supplied. Should be an array similar to:
|
prepare_sections(array $sections, $id) : \none
Loops through supplied data and prepares the $sections array.
This is different for each type of options so lets leave it blank
array | $sections | framework setup arguments. Used to change some base settings for the options including context. |
$id |
prepare_fields(array $fields, array $options, string $key) : array
Loops through supplied data and prepares the $fields array.
Function may also call itself on nested fields (groups). Returns a multilevel fields array.
array | $fields | |
array | $options | |
string | $key |
remove_clones(array $value) : array
Saving the options usually means the <code>$_POST</code> array conatins the group clones in the array keys.
These usually look like ##field-id-clone##
. this function simply looks for the existance of two hashes at the start of the supplied keys and removes them from the returning array if present.
array | $value | data supplied from the save action. |
$out the sanitized and trimmed array data.
prepare_meta_box_titles(string $context) : \none
The prepare meta box titles function is used to run through all the sections, check if a dashicon is to be prepended to the title, and if it is alter the global <code>$wp_meta_boxes</code> titles accordingly.
string | $context | which meta boxes we are going to alter. |
parse_args(array $a, array $b, string $filter) : array
Recursive array merging from a default and supplied array.
Very similar function to wp_parse_args
except it filters through the whole array tree.
array | $a | supplied value array. |
array | $b | default value array. |
string | $filter | optionally run the array through |