You appear to be a bot. Output may be restricted
Description
Build a simple array which represents the tree of posts Do we need to know if the tree is hierarchical?
Note: We pass exclude=-1 so that the current post IS included. could we have done include= instead? We need to start from the top so that we know where to go at the end of a list of children
Usage
oikp_tree( $post_type, $post_parent );
Parameters
- $post_type
- ( mixed ) required –
- $post_parent
- ( mixed ) optional –
Returns
void
Source
File name: oik-presentation/includes/oikp-lazy-nav.inc
Lines:
1 to 19 of 19
function oikp_tree( $post_type, $post_parent=0) { global $oikp_post_tree; $atts["post_parent"] = $post_parent; $atts["post_type"] = $post_type; $atts["orderby"] = "menu_order" ; $atts["order"] = "ASC"; $atts["numberposts"] = -1; $atts["exclude"] = -1; // $oikp_post_tree[] = $post; $posts = bw_get_posts( $atts ); if ( count( $posts ) ) { foreach ( $posts as $post ) { $oikp_post_tree[] = $post->ID; oikp_tree( $post->post_type, $post->ID ); } } }