Walker::unset_children() public WP 2.7.0
Unset all the children for a given top level element.
{} Это метод класса: Walker{}
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
$Walker = new Walker(); $Walker->unset_children( $e, $children_elements );
- $e(объект) (обязательный) (передается по ссылке — &)
- -
- $children_elements(массив) (обязательный) (передается по ссылке — &)
- -
Список изменений
С версии 2.7.0 | Введена. |
Код Walker::unset_children() Walker::unset children WP 5.7
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 ] );
}