Properties

$form

$form : 

The form

$form_name

$form_name : 

The form name

$form_tabs

$form_tabs : 

Tabs to build

$current_tab

$current_tab : 

Current tab

$form_items

$form_items : 

This holds the form items, determining the position

$form_item_names

$form_item_names : 

This holds the name for each items (an item can have more than one fields)

$form_item_labels

$form_item_labels : 

This holds the form label

$form_options

$form_options : 

This holds the form option aka data

$site_options

$site_options : 

$form_actions

$form_actions : array

Actions associated with this form, in addition to the default submit action

Type

array

$plugin

$plugin : \BWP_Framework_V3

The plugin that initializes this option page instance

Type

\BWP_Framework_V3

$domain

$domain : 

Text domain

Methods

__construct()

__construct(string  $form_name, \BWP_Framework_V3  $plugin) 

Constructor

Parameters

string $form_name
\BWP_Framework_V3 $plugin

init()

init(array  $form = array(), array  $form_option_keys = array()) : $this

Init the class

Parameters

array $form

form data to build the form for the current option page

array $form_option_keys

contains all option keys that should be handled by the current option page form

Returns

$this

set_form_options()

set_form_options(array  $options) 

Set options to be used for the currently active form

This allows setting arbitrary options that might not be associated with an option key.

Parameters

array $options

add_form_container()

add_form_container(string  $name, string  $container_data, boolean  $only_if_exist = true) 

Add a container for a specific field of the currently active form

Parameters

string $name

name of the field

string $container_data

data of the container

boolean $only_if_exist

only add container if $name should have it, default to true

add_form_inline()

add_form_inline(string  $name, string  $inline_data, boolean  $only_if_exist = true) 

Add inline contents to a specific field of the currently active form

Parameters

string $name

name of the field

string $inline_data

inline data to add

boolean $only_if_exist

only add inline data if $name should have inline, default to true

set_current_tab()

set_current_tab(  $current_tab) 

Parameters

$current_tab

kill_html_fields()

kill_html_fields(  $form,   $names) 

Parameters

$form
$names

generate_html_form()

generate_html_form() 

Generate HTML form

register_custom_submit_action()

register_custom_submit_action(string  $action, mixed  $callback = null) 

Register a custom submit action

Parameters

string $action

the POST action

mixed $callback

the callback to use for this action

register_custom_submit_actions()

register_custom_submit_actions(array  $actions, mixed  $callback = null) 

Register multiple custom submit actions

Parameters

array $actions

the POST actions

mixed $callback

the callback to use for all the actions, optional

submit_html_form()

submit_html_form() 

handle_form_actions()

handle_form_actions() 

Handles all kinds of form actions, including the default submit action

get_form_name()

get_form_name() 

get_form()

get_form() 

is_field_checkbox_or_radio()

is_field_checkbox_or_radio(string  $name) 

Parameters

string $name

is_field_textarea()

is_field_textarea(string  $name) 

Parameters

string $name

format_field()

format_field(  $name,   $value) 

Parameters

$name
$value

generate_field_help_attributes()

generate_field_help_attributes(string  $name, array  $attributes = array()) 

Parameters

string $name
array $attributes

attributes to merge with

generate_attribute_string()

generate_attribute_string(array  $attributes) 

Parameters

array $attributes

get_field_attributes()

get_field_attributes(string  $name) : array

Get attributes set for a field.

Should always return attributes with a "class" key

Parameters

string $name

Returns

array

generate_field_attributes()

generate_field_attributes(  $name) 

Parameters

$name

is_compound_field()

is_compound_field(  $name) 

Parameters

$name

generate_html_field()

generate_html_field(  $type = '',   $data = array(),   $name = '',   $in_section = false) 

Generate HTML field

Parameters

$type
$data
$name
$in_section

generate_html_fields()

generate_html_fields(  $type,   $name) 

Generate HTML fields

Parameters

$type
$name

is_form_item_hidden()

is_form_item_hidden(  $name) 

Parameters

$name