如果我们想排除特色贴子图像,那么下面是更新的一行:
$ids = join( \',\', wp_filter_object_list( get_attached_media(\'image\' ), [ \'ID\' => get_post_thumbnail_id() ], \'NOT\', \'ID\' ) );
此处展开:
$ids = join(
\',\', // join array by comma
wp_filter_object_list(
get_attached_media(\'image\' ), // fetch attached images
[ \'ID\' => get_post_thumbnail_id() ], // filter ID equal to featured image ID
\' NOT\', // filter operator: NOT
\'ID\' // pluck the IDs (only include)
)
);