Methods summary
public
|
#
__construct( string $form_name, array $args = array() )
Parameters
- $form_name
string $form_name
- $args
array $args
|
public
array
|
|
public
array
|
|
public
boolean|Sidecar_Field
|
#
get_field( string $field_name )
Parameters
- $field_name
string $field_name
Returns
|
public
boolean
|
#
has_field( string $field_name )
Parameters
- $field_name
string $field_name
Returns
boolean
|
public
boolean
|
|
public
boolean
|
#
get_section( string $section_name )
Parameters
- $section_name
string $section_name
Returns
boolean
|
public
boolean
|
#
has_section( string $section_name )
Parameters
- $section_name
string $section_name
Returns
boolean
|
public
boolean
|
|
public
array
|
#
get_field_names( string $section_name )
Parameters
- $section_name
string $section_name
Returns
array
|
public
boolean
|
#
has_section_fields( boolean|string $section_name = false )
Parameters
- $section_name
boolean|string $section_name
Returns
boolean
|
public
array
|
#
get_section_fields( boolean|string $section_name = false )
Parameters
- $section_name
boolean|string $section_name
Returns
array
|
public
array
|
|
public
string
|
|
public
|
#
add_button( string $button_name, string $button_text, array $args = array() )
Parameters
- $button_name
string $button_name
- $button_text
string $button_text
- $args
array $args string $type The type of button. One of: primary, secondary, delete string
$name The HTML name of the submit button. Defaults to "submit". If no id
attribute is given in $other_attributes below, $name will be used as the
button's id. bool $wrap True if the output button should be wrapped in a
paragraph tag, false otherwise. Defaults to true array|string $other_attributes
Other attributes that should be output with the button, mapping attributes to
their values, such as array( 'tabindex' => '1' ). These attributes will be
output as attribute="value", such as tabindex="1". Defaults to no other
attributes. Other attributes can also be provided as a string such as
'tabindex="1"', though the array format is typically cleaner.
|
public
boolean
|
#
get_button( string $button_name )
Parameters
- $button_name
string $button_name
Returns
boolean
|
public
|
|
public
|
|
public
|
|
public
|
|
public
object
|
#
add_section( string $section_name, array $args = array() )
Parameters
- $section_name
string $section_name
- $args
array $args
Returns
object
|
public
object
|
#
add_field( string $field_name, array $args = array() )
Parameters
- $field_name
string $field_name
- $args
array $args
Returns
object
|
public
array
|
#
get_default_settings_values( )
Get an array of new setting values (empty string; '').
Get an array of new setting values (empty string; '').
Override in subclass to add more specific setting defaults.
Returns
array
Todo
Cache new settings in a setting so that loading from front end does...
...require setting the admin form and traversing through these fields.
|
public
array
|
|
public
array
|
|
public
Sidecar_Form_Settings
|
|
public
boolean
|
#
has_setting( string $setting_name )
Parameters
- $setting_name
string $setting_name
Returns
boolean
|
public
mixed
|
#
get_setting( string $setting_name )
Parameters
- $setting_name
string $setting_name
Returns
mixed
|
public
array
|
#
update_settings_value( string $setting_name, mixed $value )
Parameters
- $setting_name
string $setting_name
- $value
mixed $value
Returns
array
|
public
array
|
#
update_settings( array $form_settings )
Parameters
- $form_settings
array $form_settings
Returns
array
|
public
array
|
|
public
array
|
|
public
array
|
#
ensure_default_values( array $field_values )
Ensure their is a default value for every field w/o a matching array
element.
Ensure their is a default value for every field w/o a matching array
element.
This is used to ensure forms POSTed back always have all fields. In cases of
checkboxes or radio buttons they may not.
Parameters
- $field_values
array $field_values
Returns
array
|