You appear to be a bot. Output may be restricted
Description
Implement "oik_shortcode_atts" filter for paginationIf the shortcode parameters includes "posts_per_page" then we need to consider pagination This means that need to be able to access the WP_Query instance used to retrieve posts So we have to create some 'slightly hidden' entries in the $atts array. 'bwscid' – the shortcode identifier 'paged' – instructs WP_Query to access a particular page 'bw_query' – the new instance of WP_Query to be used to perform the DB access
Usage
$array = oik_navi_shortcode_atts( $atts, $content, $tag );
Parameters
- $atts
- ( array ) optional – shortcode parameters to filter
- $content
- ( string ) optional – content of enclosed shortcode
- $tag
- ( string ) optional – shortcode name
Returns
array the filtered atts arraySource
File name: oik/includes/oik-shortcodes.phpLines:
1 to 15 of 15
function oik_navi_shortcode_atts( $atts=null, $content=null, $tag=null ) { $posts_per_page = bw_array_get( $atts, "posts_per_page", null ); if ( $posts_per_page ) { oik_require( "shortcodes/oik-navi.php" ); $bwscid = bw_get_shortcode_id( true ); $page = bw_check_paged_shortcode( $bwscid ); $atts['bwscid'] = $bwscid; $atts['paged'] = $page; if ( !is_numeric( $posts_per_page ) ) { $atts['posts_per_page'] = get_option( "posts_per_page" ); } $atts['bw_query'] = new WP_Query(); } return( $atts ); }View on GitHub View on Trac