public
Created

  • Download Gist
functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php
/**
* Display Posts Shortcode - Offset Posts
* @author Bill Erickson
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/
*
* @param array $args
* @param array $atts
* @return array $args
*/
function be_display_posts_shortcode_offset_posts( $args, $atts ) {
if( isset( $atts['offset'] ) ) {
$args['offset'] = (int) $atts['offset'];
}
 
return $args;
}
add_filter( 'display_posts_shortcode_args', 'be_display_posts_shortcode_offset_posts', 10, 2 );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.