PHP Class Carbon_Fields\Manager\Sidebar_Manager

Show file Open project: htmlburger/carbon-fields Class Usage Examples

Public Methods

Method Description
action_handler ( ) : array | void Handle action requests.
add_sidebar ( string $name, string $id = '' ) : boolean | WP_Error Add a new custom sidebar.
enqueue_scripts ( ) Enqueue the UI scripts.
get_sidebars ( ) : array Get all the registered custom sidebars.
instance ( ) : Sidebar_Manager Singleton implementation.
register_sidebars ( ) Register the custom sidebars.
remove_sidebar ( string $id ) : boolean | WP_Error Remove a custom sidebar by ID.

Private Methods

Method Description
setup ( ) Register actions, filters, etc.

Method Details

action_handler() public method

Handle action requests.
public action_handler ( ) : array | void
return array | void Output JSON if DOING_AJAX, otherwise return an array

add_sidebar() public method

Add a new custom sidebar.
See also: Sidebar_Manager::register_sidebars()
public add_sidebar ( string $name, string $id = '' ) : boolean | WP_Error
$name string Sidebar Name
$id string Sidebar ID
return boolean | WP_Error

enqueue_scripts() public method

Enqueue the UI scripts.
public enqueue_scripts ( )

get_sidebars() public method

Get all the registered custom sidebars.
public get_sidebars ( ) : array
return array

instance() public static method

Singleton implementation.
public static instance ( ) : Sidebar_Manager
return Sidebar_Manager

register_sidebars() public method

Register the custom sidebars.
public register_sidebars ( )

remove_sidebar() public method

Remove a custom sidebar by ID.
See also: Sidebar_Manager::register_sidebars()
public remove_sidebar ( string $id ) : boolean | WP_Error
$id string Sidebar ID
return boolean | WP_Error