Created
March 27, 2015 16:55
-
-
Save messica/8206781b7c7bd29fe6dd to your computer and use it in GitHub Desktop.
Adds a [pmproseries] shortcode to display a specific series post list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmproseries_shortcode($atts) { | |
global $post; | |
extract(shortcode_atts(array( | |
'id' => $post->ID | |
), $atts)); | |
//start output buffering | |
ob_start(); | |
$series = new PMProSeries($id); | |
$series->getPostList(true); //true echoes post list | |
$temp_content = ob_get_contents(); | |
ob_end_clean(); | |
return $temp_content; | |
} | |
add_shortcode('pmproseries', 'pmproseries_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment