1 | <?php |
||
13 | class Nav_Menu_Container extends Container { |
||
14 | /** |
||
15 | * Array of container clones for every menu item |
||
16 | * |
||
17 | * @see init() |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $menu_item_instances = array(); |
||
21 | |||
22 | /** |
||
23 | * Create a new nav menu item fields container |
||
24 | * |
||
25 | * @param string $id ID of the container |
||
|
|||
26 | **/ |
||
27 | public function __construct( $title ) { |
||
40 | |||
41 | /** |
||
42 | * Perform instance initialization after calling setup() |
||
43 | * |
||
44 | * @param int $menu_id Used to pass the correct menu_item_id to the Container object |
||
45 | * @param bool $render Whether the container will render the fields. |
||
46 | */ |
||
47 | public function init( $menu_id = 0 ) { |
||
61 | |||
62 | /** |
||
63 | * Set the menu item ID the container will operate with. |
||
64 | * |
||
65 | * @param int $menu_id |
||
66 | **/ |
||
67 | public function set_menu_id( $menu_id ) { |
||
71 | |||
72 | /** |
||
73 | * Checks whether the current request is valid |
||
74 | * |
||
75 | * @return bool |
||
76 | **/ |
||
77 | public function is_valid_save() { |
||
81 | |||
82 | /** |
||
83 | * Returns an array that holds the container data, suitable for JSON representation. |
||
84 | * This data will be available in the Underscore template and the Backbone Model. |
||
85 | * |
||
86 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
||
87 | * @return array |
||
88 | */ |
||
89 | public function to_json( $load ) { |
||
99 | |||
100 | /** |
||
101 | * Perform checks whether the container should be attached during the current request |
||
102 | * |
||
103 | * @return bool True if the container is allowed to be attached |
||
104 | **/ |
||
105 | public function is_valid_attach() { |
||
116 | |||
117 | /** |
||
118 | * Perform save operation after successful is_valid_save() check. |
||
119 | * The call is propagated to all fields in the container. |
||
120 | **/ |
||
121 | public function save( $data = null ) { |
||
129 | |||
130 | /** |
||
131 | * Output the container markup |
||
132 | **/ |
||
133 | public function render() { |
||
136 | |||
137 | /** |
||
138 | * Trigger Save for all instances |
||
139 | */ |
||
140 | public function update( $menu_id, $current_menu_item_id ) { |
||
148 | |||
149 | /** |
||
150 | * Render custom fields inside each Nav Menu entry |
||
151 | */ |
||
152 | public function form( $item ) { |
||
160 | |||
161 | /** |
||
162 | * Create a clone of this container with it's own datastore for every menu item |
||
163 | */ |
||
164 | protected function get_clone_for_menu_item( $menu_item_id ) { |
||
195 | |||
196 | /** |
||
197 | * Setup custom walker for the Nav Menu entries |
||
198 | */ |
||
199 | public static function edit_walker() { |
||
202 | |||
203 | public function add_fields( $fields ) { |
||
212 | } |
||
213 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.