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



_page_traverse_name › WordPress Function

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
  • (string[]) $result Array of page names keyed by ID (passed by reference).
    Erforderlich: Ja
Siehe:
Definiert in:
Codex:

Traverses 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 );
		}
	}
}