Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_page_traverse_name ›

Seit2.9.0
Veraltetn/v
_page_traverse_name ( $page_id, $children, $result )
Zugriff:
  • private
Parameter: (3)
  • (int) $page_id Page ID.
    Erforderlich: Ja
  • (array) $children Parent-children relations (passed by reference).
    Erforderlich: Ja
  • (array) $result Result (passed by reference).
    Erforderlich: Ja
Siehe:
Definiert in:
Codex:

Traverse and return all the nested children post names of a root page.

$children contains parent-children relations



Quellcode

function _page_traverse_name( $page_id, &$children, &$result ) {
	if ( isset( $children[ $page_id ] ) ) {
		foreach ( (array) $children[ $page_id ] as $child ) {
			$result[ $child->ID ] = $child->post_name;
			_page_traverse_name( $child->ID, $children, $result );
		}
	}
}