1 | <?php |
||
13 | class Nav_Menu_Container extends Container { |
||
14 | |||
15 | public static $instances = array(); |
||
16 | public static $active_containers = array(); |
||
17 | public static $initialized = false; |
||
18 | |||
19 | /** |
||
20 | * Create a new nav menu item fields container |
||
21 | * |
||
22 | * @param string $id ID of the container |
||
23 | **/ |
||
24 | public function __construct( $id ) { |
||
36 | |||
37 | /** |
||
38 | * Perform instance initialization after calling setup() |
||
39 | * |
||
40 | * @param int $menu_id Used to pass the correct menu_item_id to the Container object |
||
41 | * @param bool $render Whether the container will render the fields. |
||
42 | */ |
||
43 | public function init( $menu_id = 0, $render = true ) { |
||
55 | |||
56 | /** |
||
57 | * Set the menu item ID the container will operate with. |
||
58 | * |
||
59 | * @param int $menu_id |
||
60 | **/ |
||
61 | public function set_menu_id( $menu_id ) { |
||
65 | |||
66 | /** |
||
67 | * Checks whether the current request is valid |
||
68 | * |
||
69 | * @return bool |
||
70 | **/ |
||
71 | public function is_valid_save() { |
||
74 | |||
75 | /** |
||
76 | * Perform save operation after successful is_valid_save() check. |
||
77 | * The call is propagated to all fields in the container. |
||
78 | **/ |
||
79 | public function save( $user_data = null ) { |
||
87 | |||
88 | /** |
||
89 | * Returns an array that holds the container data, suitable for JSON representation. |
||
90 | * This data will be available in the Underscore template and the Backbone Model. |
||
91 | * |
||
92 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
||
93 | * @return array |
||
94 | */ |
||
95 | public function to_json( $load ) { |
||
105 | |||
106 | /** |
||
107 | * Output the container markup |
||
108 | **/ |
||
109 | public function render() { |
||
112 | |||
113 | /** |
||
114 | * TODO: make sure the containers for nav menus are not printed everywhere |
||
115 | */ |
||
116 | public function is_valid_attach() { |
||
119 | |||
120 | /** |
||
121 | * Initialize filters. This will be executed only once |
||
122 | */ |
||
123 | public static function initialize_filters() { |
||
133 | |||
134 | /** |
||
135 | * Get containers only once, and store in instance memory. |
||
136 | */ |
||
137 | public static function get_containers() { |
||
144 | |||
145 | /** |
||
146 | * Render custom fields inside each Nav Menu entry |
||
147 | */ |
||
148 | public static function form( $item ) { |
||
151 | |||
152 | /** |
||
153 | * Setup custom walker for the Nav Menu entries |
||
154 | */ |
||
155 | public static function edit_walker() { |
||
158 | |||
159 | /** |
||
160 | * Trigger Save for all instances |
||
161 | */ |
||
162 | public static function update( $menu_id, $current_menu_item_id ) { |
||
168 | |||
169 | /** |
||
170 | * Render attribute prevents field containers showing on menu save |
||
171 | */ |
||
172 | public static function set_instance_for_id( $current_menu_item_id, $render = true ) { |
||
210 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.