You appear to be a bot. Output may be restricted
Description
Implements [bw_tree] shortcodeCreate a simple tree of the 'pages' under the selected id We default the ordering to match the menu order of the pages The default tree starts from the current 'post' If post_parent=" " or post_parent=. then we use the current post's parent If you want to include the current post in the tree then add exclude=-1
Usage
bw_tree( $atts );
Parameters
- $atts
- ( mixed ) optional –
Returns
voidSource
File name: oik/shortcodes/oik-tree.phpLines:
1 to 23 of 23
function bw_tree( $atts = NULL ) { $atts['orderby'] = bw_array_get($atts, "orderby", "menu_order" ); $atts['order'] = bw_array_get( $atts, "order", "ASC" ); $atts['post_parent'] = bw_array_get( $atts, "post_parent", null ); //bw_trace2( "!{$atts['post_parent']}!", "derr" ); switch ( $atts['post_parent'] ) { case null: $atts['post_parent'] = bw_global_post_id(); break; case " ": case ".": $post = bw_global_post(); if ( $post ) { $atts['post_parent'] = $post->post_parent; } break; default: // Assume it's an integer and carry on. } bw_tree_func( $atts ); return( bw_ret() ); }View on GitHub View on Trac