在过滤器的WordPress文档中可以找到与您的问题几乎相同的用例admin_post_thumbnail_html
.
连接到此的过滤器将接收管理屏幕的HTML,如下所示$content
. 根据需要修改并返回此标记。
function filter_featured_image_admin_text( $content, $post_id, $thumbnail_id ){
$help_text = \'<p>\' . __( \'Please use an image that is 1170 pixels wide x 658 pixels tall.\', \'my_domain\' ) . \'</p>\';
return $help_text . $content;
}
add_filter( \'admin_post_thumbnail_html\', \'filter_featured_image_admin_text\', 10, 3 );
详细信息如下:
https://developer.wordpress.org/reference/hooks/admin_post_thumbnail_html/