I have a simple custom shortcode plugin where you give it a tag and it'll display the titles of all the posts with that tag.
e.g. In my post if I type "[listposts tag=oct-2011]" it will output the titles of all posts tagged as "oct-2011".
This plugin has been working fine for me until the v3.2 upgrade.
Now, it still works fine when the post which uses the shortcode is viewed on its own. But when that post is viewed on the homepage, the get_posts() query returns 0 results.
What do I need to do to fix the plugin?
Here is the relevant code:
function listposts($atts) {
$atts = shortcode_atts(
array(
'tag' = 'jan-2011',
'numberposts' = '-1',
'orderby' = 'post_date',
'order' = 'asc',
'post_status' = 'any' ),
$atts);
$catposts = get_posts($atts);
$out = '';
foreach ($catposts as $single) {
$out .= $single->post_title;
}
return $out;
}