PHP Class Carbon_Fields\Container\Nav_Menu_Container

Inheritance: extends Container
Afficher le fichier Open project: htmlburger/carbon-fields

Méthodes publiques

Свойство Type Description
$active_containers
$initialized
$instances

Méthodes publiques

Méthode Description
__construct ( string $id ) Create a new nav menu item fields container
edit_walker ( ) Setup custom walker for the Nav Menu entries
form ( $item ) Render custom fields inside each Nav Menu entry
get_containers ( ) Get containers only once, and store in instance memory.
init ( integer $menu_id, boolean $render = true ) Perform instance initialization after calling setup()
initialize_filters ( ) Initialize filters. This will be executed only once
is_valid_attach ( ) TODO: make sure the containers for nav menus are not printed everywhere
is_valid_save ( ) : boolean Checks whether the current request is valid
render ( ) Output the container markup
save ( $user_data = null ) Perform save operation after successful is_valid_save() check.
set_instance_for_id ( $current_menu_item_id, $render = true ) Render attribute prevents field containers showing on menu save
set_menu_id ( integer $menu_id ) Set the menu item ID the container will operate with.
to_json ( boolean $load ) : array Returns an array that holds the container data, suitable for JSON representation.
update ( $menu_id, $current_menu_item_id ) Trigger Save for all instances

Method Details

__construct() public méthode

Create a new nav menu item fields container
public __construct ( string $id )
$id string ID of the container

edit_walker() public static méthode

Setup custom walker for the Nav Menu entries
public static edit_walker ( )

form() public static méthode

Render custom fields inside each Nav Menu entry
public static form ( $item )

get_containers() public static méthode

Get containers only once, and store in instance memory.
public static get_containers ( )

init() public méthode

Perform instance initialization after calling setup()
public init ( integer $menu_id, boolean $render = true )
$menu_id integer Used to pass the correct menu_item_id to the Container object
$render boolean Whether the container will render the fields.

initialize_filters() public static méthode

Initialize filters. This will be executed only once
public static initialize_filters ( )

is_valid_attach() public méthode

TODO: make sure the containers for nav menus are not printed everywhere
public is_valid_attach ( )

is_valid_save() public méthode

Checks whether the current request is valid
public is_valid_save ( ) : boolean
Résultat boolean

render() public méthode

Output the container markup
public render ( )

save() public méthode

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

set_instance_for_id() public static méthode

Render attribute prevents field containers showing on menu save
public static set_instance_for_id ( $current_menu_item_id, $render = true )

set_menu_id() public méthode

Set the menu item ID the container will operate with.
public set_menu_id ( integer $menu_id )
$menu_id integer

to_json() public méthode

This data will be available in the Underscore template and the Backbone Model.
public to_json ( boolean $load ) : array
$load boolean Should the value be loaded from the database or use the value from the current instance.
Résultat array

update() public static méthode

Trigger Save for all instances
public static update ( $menu_id, $current_menu_item_id )

Property Details

$active_containers public_oe static_oe property

public static $active_containers

$initialized public_oe static_oe property

public static $initialized

$instances public_oe static_oe property

public static $instances