add_action( \'add_meta_boxes\', \'attached_images_meta\' );
function attached_images_meta() {
$screens = array( \'post\', \'page\' ); //add more in here as you see fit
foreach ($screens as $screen) {
add_meta_box(
\'attached_images_meta_box\', //this is the id of the box
\'Attached Images\', //this is the title
\'attached_images_meta_box\', //the callback
$screen, //the post type
\'side\' //the placement
);
}
}
function attached_images_meta_box($post){
$args = array(\'post_type\'=>\'attachment\',\'post_parent\'=>$post->ID);
$count = count(get_children($args));
echo \'<a href="#" class="button insert-media add_media" data-editor="content">\'.$count.\' Images</a>\';
}
以上内容将链接到媒体上载程序。我添加了链接,因为你发布的屏幕截图看起来像一个链接。请随意删除链接,如下所示:
echo $count.\' Images\';
只要在你的函数中弹出这个。php、自定义插件等。