PHP Class Pressbooks\Options

Mostrar archivo Open project: pressbooks/pressbooks

Public Methods

Method Description
display ( ) Display the options page or tab description.
filterDefaults ( array $defaults ) : array Filter the array of default values for this set of options
getDefaults ( ) : array Get an array of default values for this set of options
getSlug ( ) : string Get the slug for this options page or tab.
getTitle ( ) : string Get the localized title of this options page or tab.
init ( ) Configure the options page or tab using the settings API.
render ( ) Render the options page or tab.
sanitize ( array $input ) : array Sanitize various options (boolean, string, integer, float).
upgrade ( integer $version ) Upgrade handler for the options page or tab.

Protected Methods

Method Description
renderCheckbox ( string $id, string $name, string $option, string $value = '', string $description ) Render a checkbox.
renderCustomSelect ( string $id, string $name, string $value = '', string $args, boolean $multiple = false ) Render a custom select element.
renderField ( string $id, string $name, string $option, string $value = '', string $description = '', string $append = '', string $type = 'text', $class = 'regular-text', boolean $disabled = false ) Render an input.
renderRadioButtons ( string $id, string $name, string $option, string $value = '', string $args, boolean $custom = false ) Render radio buttons.
renderSelect ( string $id, string $name, string $option, string $value = '', string $args, boolean $multiple = false ) Render a select element.

Method Details

display() abstract public method

Display the options page or tab description.
abstract public display ( )

filterDefaults() abstract static public method

Filter the array of default values for this set of options
abstract static public filterDefaults ( array $defaults ) : array
$defaults array
return array $defaults

getDefaults() abstract static public method

Get an array of default values for this set of options
abstract static public getDefaults ( ) : array
return array $defaults

getSlug() abstract static public method

Get the slug for this options page or tab.
abstract static public getSlug ( ) : string
return string $slug

getTitle() abstract static public method

Get the localized title of this options page or tab.
abstract static public getTitle ( ) : string
return string $title

init() abstract public method

Configure the options page or tab using the settings API.
abstract public init ( )

render() abstract public method

Render the options page or tab.
abstract public render ( )

renderCheckbox() protected method

Render a checkbox.
protected renderCheckbox ( string $id, string $name, string $option, string $value = '', string $description )
$id string
$name string
$option string
$value string
$description string

renderCustomSelect() protected method

Render a custom select element.
protected renderCustomSelect ( string $id, string $name, string $value = '', string $args, boolean $multiple = false )
$id string
$name string
$value string
$args string
$multiple boolean

renderField() protected method

Render an input.
protected renderField ( string $id, string $name, string $option, string $value = '', string $description = '', string $append = '', string $type = 'text', $class = 'regular-text', boolean $disabled = false )
$id string
$name string
$option string
$value string
$description string
$append string
$type string
$disabled boolean

renderRadioButtons() protected method

Render radio buttons.
protected renderRadioButtons ( string $id, string $name, string $option, string $value = '', string $args, boolean $custom = false )
$id string
$name string
$option string
$value string
$args string
$custom boolean

renderSelect() protected method

Render a select element.
protected renderSelect ( string $id, string $name, string $option, string $value = '', string $args, boolean $multiple = false )
$id string
$name string
$option string
$value string
$args string
$multiple boolean

sanitize() public method

Sanitize various options (boolean, string, integer, float).
public sanitize ( array $input ) : array
$input array
return array $options

upgrade() abstract public method

Upgrade handler for the options page or tab.
abstract public upgrade ( integer $version )
$version integer