Fieldmanager
  • Package
  • Class
  • Tree
  • Todo

Packages

  • Fieldmanager
    • Context
    • Datasource
    • Field
    • Util
  • None

Classes

  • Fieldmanager_Autocomplete
  • Fieldmanager_Checkbox
  • Fieldmanager_Checkboxes
  • Fieldmanager_Colorpicker
  • Fieldmanager_Datepicker
  • Fieldmanager_DraggablePost
  • Fieldmanager_Field
  • Fieldmanager_Grid
  • Fieldmanager_Group
  • Fieldmanager_Hidden
  • Fieldmanager_Link
  • Fieldmanager_Media
  • Fieldmanager_Options
  • Fieldmanager_Password
  • Fieldmanager_Radios
  • Fieldmanager_RichTextArea
  • Fieldmanager_Select
  • Fieldmanager_TextArea
  • Fieldmanager_TextField

Class Fieldmanager_Options

Abstract base class for handling option fields, like select elements, checkboxes or radios.

Fieldmanager_Field
Extended by Fieldmanager_Options

Direct known subclasses

Fieldmanager_Checkboxes, Fieldmanager_Radios, Fieldmanager_Select

Abstract
Package: Fieldmanager\Field
Located at class-fieldmanager-options.php

Methods summary

public
# __construct( string $label = '', mixed $options = array() )

Add CSS, construct parent

Add CSS, construct parent

Parameters

$label
string
$label
$options
mixed
$options

Overrides

Fieldmanager_Field::__construct
public array|string
# sanitize( array|string $value )

Sanitize function that can handle arrays as well as string values.

Sanitize function that can handle arrays as well as string values.

Parameters

$value
array|string
$value

Returns

array|string
Sanitized $value
public
# add_options( array $options )

Add options

Add options

Parameters

$options
array
$options
public string
# form_data_elements( mixed $value )

Generate form elements.

Generate form elements.

Parameters

$value
mixed
$value

Returns

string
HTML
public
# form_data_element( mixed $data_row, mixed $value )

A single element for a single bit of data, e.g. '<option>'

A single element for a single bit of data, e.g. '<option>'

Parameters

$data_row
mixed
$value
$value
public string
# option_selected( string $current_option, array $options, string $attribute )

Helper for output functions to toggle a selected options

Helper for output functions to toggle a selected options

Parameters

$current_option
string
$current_option this option
$options
array
$options all valid options
$attribute
string
$attribute

Returns

string
$attribute on match, empty on failure.
public mixed[]
# presave_all( mixed $values, mixed $current_values )

Override presave_all to handle special cases associated with multiple options fields.

Override presave_all to handle special cases associated with multiple options fields.

Returns

mixed[]
sanitized values

Input

mixed[] $values

Overrides

Fieldmanager_Field::presave_all
public sanitized
# presave( mixed $value, mixed $current_value = array() )

Presave function, which handles sanitization and validation

Presave function, which handles sanitization and validation

Parameters

$value
mixed
$value If a single field expects to manage an array, it must override presave()
$current_value

Returns

sanitized
values.

Overrides

Fieldmanager_Field::presave
public
# preload_alter_values( array $values )

Alter values before rendering

Alter values before rendering

Parameters

$values
array
$values

Overrides

Fieldmanager_Field::preload_alter_values
public int[]
# presave_alter_values( int[] $values, int[] $current_values = array() )

Presave hook to set taxonomy data, maybe

Presave hook to set taxonomy data, maybe

Parameters

$values
int[]
$values
$current_values
int[]
$current_values

Returns

int[]
$values

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(), form_element(), get_collapse_handle(), get_element_attributes(), get_element_id(), get_element_key(), get_element_label(), get_extra_element_classes(), get_form_name(), get_form_tree(), get_remove_handle(), get_sort_handle(), is_group(), is_repeatable(), set_options(), single_element_markup(), wrap_with_multi_tools()

Magic methods summary

Properties summary

public array $data
#

Full option data, allows grouping

Full option data, allows grouping

public array $options
#

Shortcut to data which allows a simple associative array

Shortcut to data which allows a simple associative array

public boolean $grouped
#

Is the data grouped? E.g. should we use <optgroup>

Is the data grouped? E.g. should we use <optgroup>

public array $first_element
#

Always prepend this element to the $data

Always prepend this element to the $data

public boolean $multiple
#

Allow multiple selections?

Allow multiple selections?

public string $options_template
#

Path to an options template to load.

Path to an options template to load.

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, $field_class, $index, $index_filter, $inline_label, $input_type, $is_attachment, $label, $label_after_element, $label_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

Fieldmanager API documentation generated by ApiGen 2.8.0