final class Form_Builder

A class to automate the creation of timers through form submissions.

Constants

FORM_BASE_NAME

FORM_NONCE_NAME

FORM_NONCE_ACTION

Methods

static string[]
get_timer_classes()

Return the registered Timer classes.

static 
enqueue_form_builder_scripts()

Enqueue the scripts and styles for the form builder.

static 
add_timer_class(string $class_name)

Register a Timer with the Form Builder.

static 
print_form(string $group)

Print the Timer builder form.

static null|array
get_form(string $group)

Get a submitted Timer form or return NULL if it does not exist.

static null|WP_Error|Timer
generate_timer_from_form(string $group, string $id, array $options)

Takes the name of a timer form submitted and the desired timer ID and creates a new Timer instance from it.

static string
generate_form_input_name(string $group, string|array $input)

A function to generate a name for form inputs.

Details

at line 45
final static string[] get_timer_classes()

Return the registered Timer classes.

Return Value

string[]

The Timer classes registered.

at line 52
final static enqueue_form_builder_scripts()

Enqueue the scripts and styles for the form builder.

at line 62
final static add_timer_class(string $class_name)

Register a Timer with the Form Builder.

Parameters

string $class_name

at line 80
final static print_form(string $group)

Print the Timer builder form.

Parameters

string $group

What name to categorize this form under.

at line 91
final static null|array get_form(string $group)

Get a submitted Timer form or return NULL if it does not exist.

Parameters

string $group

The group name of the form.

Return Value

null|array

The posted form or NULL.

at line 108
final static null|WP_Error|Timer generate_timer_from_form(string $group, string $id, array $options)

Takes the name of a timer form submitted and the desired timer ID and creates a new Timer instance from it.

Parameters

string $group

The name of the form group with was submitted.

string $id

The unique string identifier you want to have attached to your timer.

array $options

Return Value

null|WP_Error|Timer

The newly created/updated Timer instance.

at line 137
final static string generate_form_input_name(string $group, string|array $input)

A function to generate a name for form inputs.

Parameters

string $group

The primary group to submit the form under..

string|array $input

Either a single key or an array of nested keys to create the input name under.

Return Value

string

The generated input name, or an empty string if it could not be generated.