I'm adding custom meta to my attachment files, and want to store three page IDs per attachment in an array.
Then, I want to do a get_posts for attachments whos ID exist in this array, but the array is being returned as empty.
$p_downloads = get_posts(array(
'post_type' => 'attachment',
'post_mime_type' => 'application/pdf',
'meta_key' => 'bv_media_meta_procedure',
'meta_value' => $post->ID,
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => -1
));
Currently the post meta of bv_media_meta_procedure for one of the attachments is looking like this:
array (size=1)
0 =>
array (size=3)
0 => string '238' (length=3)
1 => string 'null' (length=4)
2 => string 'null' (length=4)
So on the page ID of 238, I expect to see the attachment being returned in the get_posts function.
But it's returning empty, how comes?