final class Settings_Field

A class to automate the process of creating a Settings Field under a Settings Section.

Properties

protected Settings_Section $Settings_Section
string $key
string $label
string $type
string $value

Methods

__construct(Settings_Section $Settings_Section, array $args)

Construct the Settings Field.

string
get_field_name()

Create a reusable Field ID.

string
get_input_name()

Create a reusable input ID.

render()

The function which gets called to print the Field's HTML.

to_array()

Export the public properties of this Field to an array.

Details

at line 57
__construct(Settings_Section $Settings_Section, array $args)

Construct the Settings Field.

Parameters

Settings_Section $Settings_Section

The parent Settings Section.

array $args

The settings passed to this Settings Field.

at line 95
final string get_field_name()

Create a reusable Field ID.

Return Value

string

An identifier for this Field.

at line 110
final string get_input_name()

Create a reusable input ID.

Return Value

string

An identifier for an input.

at line 123
final render()

The function which gets called to print the Field's HTML.

at line 137
final to_array()

Export the public properties of this Field to an array.