Description
Implement [bw_pages] shortcodePossibly the most advanced of the shortcodes in the oik base plugin. This shortcode will list items of your choosing with powerful selection and formatting criteria. This documentation doesn't do the shortcode justice! ? 2013/06/17 [bw_pages class="classes for bw_block"
- post_type='page'
- post_parent
- orderby='title'
- order='ASC'
- posts_per_page=-1
- block=true or false
- thumbnail=specification – see bw_thumbnail
- customcategoryname=custom category value
- format=formatting string
Usage
$string = bw_pages( $atts );Parameters
- $atts
- ( array ) optional – shortcode parameters
Returns
string the generated HTML outputSource
File name: oik/shortcodes/oik-pages.phpLines:
1 to 23 of 23
function bw_pages( $atts = NULL ) { $atts['numberposts'] = bw_array_get( $atts, 'numberposts', 10 ); $args = $atts; unset( $args['format']); $cp = bw_current_post_id(); $posts = bw_get_posts( $args ); // If we get into an infinite loop during development then you'll want to uncomment this line. //return( "shortcircuit"); bw_trace( $posts, __FUNCTION__, __LINE__, __FILE__, "posts" ); if ( $posts ) { // Don't process the current post inside the loop bw_process_this_post( $cp ); $bw_post_formatter = bw_query_post_formatter( $atts ); foreach ( $posts as $post ) { bw_current_post_id( $post->ID ); $bw_post_formatter( $post, $atts ); } } bw_current_post_id( $cp ); return( bw_ret() ); }View on GitHub View on Trac
Called by
1 to 1 of 1
Invoked by
Calls
1 to 8 of 8
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_clear_processed_posts() – Clear the array of processed posts
- bw_current_post_id() – Set/return the current post ID
- bw_get_posts() – Wrapper to get_posts()
- bw_pages() – Implement [bw_pages] shortcode
- bw_query_post_formatter() – Return the function to be used to format posts
- bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
- bw_trace() – Log a simple trace record to the trace log file if tracing is active
