PHP Class Carbon_Fields\Container\Theme_Options_Container

Inheritance: extends Container
Exibir arquivo Open project: htmlburger/carbon-fields

Public Properties

Property Type Description
$icon
$settings

Protected Properties

Property Type Description
$registered_pages

Public Methods

Method Description
__construct ( string $title ) Create a new theme options fields container
add_fields ( array $fields ) Append array of fields to the current fields set. All items of the array must be instances of Field and their names should be unique for all Carbon containers.
attach ( ) Add theme options container pages.
detach ( ) Revert the result of attach()
drop_unique_page ( ) Unregister the container parent and child pages.
init ( ) Attach container as a theme options page/subpage.
is_active ( ) Whether this container is currently viewed.
is_valid_save ( ) : boolean Perform checks whether the current save() request is valid.
render ( ) Output the container markup
save ( mixed $user_data = null ) Perform save operation after successful is_valid_save() check.
set_icon ( $icon ) Set the icon of this theme options page.
set_page_file ( $file ) Set the theme options file name of this container.
set_page_parent ( $parent ) Change the parent theme options page of this container
set_page_permissions ( $permissions ) Set the permissions necessary to view the corresponding theme options page
verify_unique_page ( ) Make sure that there are no duplicate containers with the same name.

Protected Methods

Method Description
clear_string ( $string ) Sanitize the container title for use in the theme options file name.

Method Details

__construct() public method

Create a new theme options fields container
public __construct ( string $title )
$title string Unique title of the container

add_fields() public method

If a field does not have DataStore already, the container data store is assigned to them instead.
public add_fields ( array $fields )
$fields array

attach() public method

Hook the container saving action.
public attach ( )

clear_string() protected method

Sanitize the container title for use in the theme options file name.
protected clear_string ( $string )

detach() public method

Revert the result of attach()
public detach ( )

drop_unique_page() public method

Unregister the container parent and child pages.
public drop_unique_page ( )

init() public method

Attach container as a theme options page/subpage.
public init ( )

is_active() public method

Whether this container is currently viewed.
public is_active ( )

is_valid_save() public method

Perform checks whether the current save() request is valid.
public is_valid_save ( ) : boolean
return boolean

render() public method

Output the container markup
public render ( )

save() public method

The call is propagated to all fields in the container.
public save ( mixed $user_data = null )
$user_data mixed

set_icon() public method

Applicable only for parent theme option pages.
public set_icon ( $icon )

set_page_file() public method

Set the theme options file name of this container.
public set_page_file ( $file )

set_page_parent() public method

Change the parent theme options page of this container
public set_page_parent ( $parent )

set_page_permissions() public method

Set the permissions necessary to view the corresponding theme options page
public set_page_permissions ( $permissions )

verify_unique_page() public method

Make sure that there are no duplicate containers with the same name.
public verify_unique_page ( )

Property Details

$icon public_oe property

public $icon

$registered_pages protected_oe static_oe property

protected static $registered_pages

$settings public_oe property

public $settings