# Class Sidecar_Form

Located at classes/class-form.php

Methods summary
`public` | # `__construct( string $form_name, array $args = array() )` #### Parameters $form_name `string` $form_name $args `array` $args
`public array` | # `get_sections( )` #### Returns `array`
`public array` | # `get_fields( )` #### Returns `array`
`public boolean|`Sidecar_Field`` | # `get_field( string $field_name )` #### Parameters $field_name `string` $field_name #### Returns `boolean|`Sidecar_Field``
`public boolean` | # `has_field( string $field_name )` #### Parameters $field_name `string` $field_name #### Returns `boolean`
`public boolean` | # `has_fields( )` #### Returns `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` | # `has_sections( )` #### Returns `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` | # `the_form( )` #### Returns `array`
`public string` | # `get_html( )` #### Returns `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` | # `initialize( )`
`public` | # `initialize_sections( `Sidecar_Plugin_Base` $plugin )` #### Parameters $plugin ``Sidecar_Plugin_Base`` $plugin
`public` | # `_the_form_field_callback( array $args )` #### Parameters $args `array` $args
`public` | # `initialize_buttons( `Sidecar_Plugin_Base` $plugin )` #### Parameters $plugin ``Sidecar_Plugin_Base`` $plugin
`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` | # `get_empty_field_values( )` #### Returns `array`
`public array` | # `get_settings_values( )` #### Returns `array`
`public `Sidecar_Form_Settings`` | # `get_settings( )` #### Returns ``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` | # `update_settings_values( array $form_settings )` #### Parameters $form_settings `array` $form_settings #### Returns `array`
`public array` | # `get_required_field_names( )` #### Returns `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`

Properties summary
`public `Sidecar_Plugin_Base`` | $plugin | `` | #
`public `Sidecar_Admin_Page`` | $admin_page | `` | #
`public string` | $form_name | `` | #
`public string` | $form_label | `` | #
`public boolean` | $requires_api | `` | #