Properties

$version

$version : string

Type

string — Class version.

$args

$args : array

Type

array — Class args to be run attached after <code>parse_args</code>.

$domain

$domain : string

Type

string — Class text domain.

$url

$url : string

Type

string — fluent url.

$assets_loaded

$assets_loaded : boolean

Type

boolean — stores if the assets were loaded.

Methods

__construct()

__construct(array $args) : \none

__construct() parse arguments supplied, setup the class.

Parameters

array $args

class setup arguments. Used to change some base settings.

Returns

\none

response()

response() : \none

Respond to ajax requests of the form being submitted.

Returns

\none

get_form()

get_form() : \none

Returns the form html, and conditionally loads assets.

Returns

\none

the_form()

the_form() : \none

Echo wrapper around the <code>get_form();</code> function.

Returns

\none

parse_args()

parse_args(array $a, array $b, string $filter) : array

Recursive array merging from a default and supplied array.

Very similar function to wp_parse_args except it filters through the whole array tree.

Parameters

array $a

supplied value array.

array $b

default value array.

string $filter

optionally run the array through apply_filters before returning.

Returns

array

provide()

provide(string $key) : array

The provide function is just a shorthand wrapper for suppling a class object and method as array in WordPress actions and filters.

Parameters

string $key

the method name to be added to the array: array( &$this, $key ).

Returns

array

random_string()

random_string(string $length) : string

Helper function used inside the <code>guid()</code> function to generate random strings.

Parameters

string $length

the number of characters to return.

Returns

string

guid()

guid() : string

Guid function used to reformat array index values before sedning them to the fields.

Simply replicates the behaviour found in framework javascript.

Returns

string

default_args()

default_args() : array

Function used across extended classes used in conjunction with <code>parse_args</code> to format supplied arrays and ensure all keys are supplied.

Returns

array

load_assets()

load_assets() : \none

Conditionally load the assets. This class could be used more than once but we only need to enqueue it once.

Returns

\none