I cannot get images to come up as enclosures in WPMU 2.8.4a. I'm using the WP RSS Images plugin. The get_children function returns nothing every time. I've tried modifying the query string quite a few times to no avail. Here are the pertinent parts of the code (modified from original plugin source for debugging purposes):
if ($rss2_img_ch == 1) add_action('rss2_item', 'wp_rss_include');
...
function wp_rss_include (){
$image_size = get_option('rss_image_size_op');
if (isset($image_size)) $image_url = rss_image_url($image_size);
else $image_url = rss_image_url('medium');
...
function rss_image_url($default_size = 'medium') {
global $post;
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID, // any parent
);
$attachments = get_posts($args);
//ALWAYS RETURNS NOTHIN!
if ($post->ID == 3231) print_r($attachments);die('bah');
...
My output does end with 'bah', but there's no array output preceding it.
I've tried post_status set to inherit, numberposts set to 1, i've removed arguments, added post_mime_type set to 'image', tried changing post_type to 'revision' (because I know that when it's called from the footer of the edit post page, get_children is working as expected). It's as if something about the Loop that I'm in forbids query_posts from returning children.
Very strange. I'm very comfortable messing around in PHP so don't hold back.