Uses
Uses | Description |
---|---|
wp-includes/class-wp-walker.php: Walker::unset_children() | Unset all the children for a given top level element. |
Unset all the children for a given top level element.
(object) (Required)
(array) (Required)
File: wp-includes/class-wp-walker.php
public function unset_children( $e, &$children_elements ) { if ( ! $e || ! $children_elements ) { return; } $id_field = $this->db_fields['id']; $id = $e->$id_field; if ( ! empty( $children_elements[ $id ] ) && is_array( $children_elements[ $id ] ) ) { foreach ( (array) $children_elements[ $id ] as $child ) { $this->unset_children( $child, $children_elements ); } } unset( $children_elements[ $id ] ); }
Version | Description |
---|---|
2.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/walker/unset_children