Class Fieldmanager_Group
Define a groups of fields.
Groups shouldn't just be thought of as a top-level collection of fields (like a meta box). Groups can be infinitely nested, they can be used to create tabbed interfaces, and so on. Groups submit data as nested arrays.
- Fieldmanager_Field
- Fieldmanager_Group
Methods summary
public
|
#
__construct( string $label = '', array $options = array() )
Constructor; add CSS if we're looking at a tabbed view |
public
string
|
#
form_element( mixed $value = NULL )
Render the element, iterating over children and calling their form_element() functions. |
public
|
|
public
mixed[]
|
|
public
string
|
|
public
string
|
#
wrap_with_multi_tools( string $html, mixed $classes = array() )
Groups have their own drag and remove tools in the label. |
public
array
|
Methods inherited from Fieldmanager_Field
_invalid_definition()
,
_unauthorized_access()
,
activate_submenu_page()
,
add_another()
,
add_meta_box()
,
add_page_form()
,
add_quickedit_box()
,
add_submenu_page()
,
add_term_meta_box()
,
add_user_form()
,
element_markup()
,
escape()
,
get_collapse_handle()
,
get_element_attributes()
,
get_element_id()
,
get_element_key()
,
get_form_name()
,
get_form_tree()
,
get_remove_handle()
,
get_sort_handle()
,
is_group()
,
is_repeatable()
,
preload_alter_values()
,
presave_all()
,
set_options()
,
single_element_markup()
Magic methods summary
Properties summary
public
|
$children |
#
Children elements of this group. Not much point in creating an empty group. |
public
string
|
$field_class |
#
Override field class |
public
string
|
$label_element |
#
Override label element |
public
boolean
|
$collapsible |
#
If true, this group can be collapsed by clicking its header. |
public
boolean
|
$collapsed |
#
If true, this group is collapsed by default. |
public
boolean|string
|
$tabbed |
#
Use tabbed groups. Currently supports "horizontal" or "vertical". Default is false, which means that the group will not be tabbed. |
public
integer
|
$tab_limit |
#
How many tabs, maximum? |
public
boolean
|
$persist_active_tab |
#
Persist the active tab on the group between sessions |
public
array
|
$label_macro |
#
Label macro is a more convenient shortcut to label_format and label_token. The first element of the two-element array is the title with a placeholder (%s), and the second element is simply the name of the child element to pull from, e.g.: array( 'Section: %s', 'section_title' ) |
public
string
|
$label_format |
#
If specified, $label_format combined with $label_token will override $label, but only if $(label).find(label_token).val() is not null. |
public
string
|
$label_token |
#
CSS selector to an element to get the token for the label format |
public
callable|null
|
$group_is_empty |
#
Function that tells whether the group is empty or not. Gets an array of form values. |
public
boolean
|
$add_to_prefix |
#
Should the group name be included in the meta key prefix for separate fields? Default is true. |
public
boolean
|
$has_unserialized_descendants |
#
Flag that this field has some descendant with $serialize_data => false. |
Properties inherited from Fieldmanager_Field
$add_more_label
,
$add_more_position
,
$attributes
,
$data_id
,
$data_type
,
$datasource
,
$debug
,
$default_value
,
$description
,
$description_after_element
,
$display_if
,
$escape
,
$extra_elements
,
$index
,
$index_filter
,
$inline_label
,
$input_type
,
$is_attachment
,
$label
,
$label_after_element
,
$limit
,
$meta_boxes_to_remove
,
$minimum_count
,
$name
,
$one_label_per_item
,
$remove_default_meta_boxes
,
$required
,
$sanitize
,
$save_empty
,
$serialize_data
,
$skip_save
,
$sortable
,
$template
,
$validate
,
$validation_messages
,
$validation_rules