Properties

$form_data

$form_data : bool|array

Type

normal

$error_class

$error_class : string

Type

normal

$errors

$errors : array

Type

normal

$notices

$notices : array

Type

normal

$types

$types : array

Type

normal

Methods

__construct()

__construct(bool  $form_data = false) : mixed

Forms constructor.

Parameters

bool $form_data

Returns

mixed

set_data()

set_data(array  $data) : self

Set Form Data

Parameters

array $data

Returns

self

display()

display(bool  $display = true) : string

Render form

Parameters

bool $display

Returns

string

validate_type()

validate_type(array  $data) : bool

Validate type of the field

Parameters

array $data

Returns

bool

get_field_value()

get_field_value(array  $field_data, string  $i = '') : string|array

Get field value

Parameters

array $field_data
string $i

Returns

string|array

render_form_row()

render_form_row(array  $data) : string

Render form row

Parameters

array $data

Returns

string

render_section()

render_section(array  $data) : string

Render form section

Parameters

array $data

Returns

string

render_label()

render_label(array  $data) : string

Render field label

Parameters

array $data

Returns

string

render_button()

render_button(string  $id, array  $data) : string

Render button

Parameters

string $id
array $data

Returns

string

render_hidden()

render_hidden(string  $id, string  $value) : string

Render hidden field

Parameters

string $id
string $value

Returns

string

render_field_label()

render_field_label(array  $data) : string

Render field label

Parameters

array $data

Returns

string

render_media()

render_media(array  $field_data) : string

Render media uploader field

Parameters

array $field_data

Returns

string

render_text()

render_text(array  $field_data) : string

Render text field

Parameters

array $field_data

Returns

string

render_number()

render_number(array  $field_data) : string

Render text field

Parameters

array $field_data

Returns

string

render_textarea()

render_textarea(array  $field_data) : string

Render text field

Parameters

array $field_data

Returns

string

render_location_autocomplete()

render_location_autocomplete(array  $field_data) : string

Render location autocomplete field

Parameters

array $field_data

Returns

string

render_password()

render_password(array  $field_data) : string

Render password field

Parameters

array $field_data

Returns

string

render_select()

render_select(array  $field_data) : string

Render dropdown field

Parameters

array $field_data

Returns

string

render_conditional_radio()

render_conditional_radio(array  $field_data) : string

Render conditional radio

Parameters

array $field_data

Returns

string

render_radio()

render_radio(array  $field_data) : string

Render radio

Parameters

array $field_data

Returns

string

render_checkbox()

render_checkbox(array  $field_data) : string

Render checkbox

Parameters

array $field_data

Returns

string

render_wp_editor()

render_wp_editor(array  $field_data) : string

Render WP Editor field

Parameters

array $field_data

Returns

string

filter_mce_buttons()

filter_mce_buttons(array  $mce_buttons, int  $editor_id) : array

Remove unusable MCE button for JB WP Editors

Parameters

array $mce_buttons
int $editor_id

Returns

array

render_datepicker()

render_datepicker(array  $field_data) : string

Render datepicker field

Parameters

array $field_data

Returns

string

add_error()

add_error(string  $field, string  $text) : mixed

Add form error

Parameters

string $field
string $text

Returns

mixed

add_notice()

add_notice(string  $text, string  $key) : mixed

Add form notice

Parameters

string $text
string $key

Returns

mixed

has_error()

has_error(string  $field) : bool

If a form has error by field key

Parameters

string $field

Returns

bool

has_errors()

has_errors() : bool

If a form has errors

Returns

bool

has_notices()

has_notices() : bool

If a form has notices

Returns

bool

flush_errors()

flush_errors() : mixed

Flush errors

Returns

mixed

flush_notices()

flush_notices() : mixed

Flush notices

Returns

mixed

get_error()

get_error(string  $field) : string|array

Get a form error by a field key

Parameters

string $field

Returns

string|array

get_notices()

get_notices() : array

Get a form notices

Returns

array