wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_page_traverse_name › WordPress Function

Da2.9.0
Deprecaton/a
_page_traverse_name ( $page_id, $children, $result )
Accedi:
  • private
Parametri: (3)
  • (int) $page_id Page ID.
    Richiesto:
  • (array) $children Parent-children relations (passed by reference).
    Richiesto:
  • (string[]) $result Array of page names keyed by ID (passed by reference).
    Richiesto:
Vedi:
Definito a:
Codex:

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

$children contains parent-children relations


Sorgenti

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