你可以通过添加一个通知来做到这一点,它们会出现在那个地方。
像这样的东西只会为页面添加一个通知。显然,您需要调整CPT的if语句,并在您想要的页面上显示。
function my_admin_notice() {
global $pagenow;
if (( $pagenow == \'edit.php\' ) && ($_GET[\'post_type\'] == \'page\')) {
echo \'<div class="updated custom-notice"><p>My Notice</p></div>\';
}
}
add_action(\'admin_notices\', \'my_admin_notice\');
您可以通过
custom-notice
班

And technically... 当然,您可以使用JS,但如果您只想添加一些文本,甚至可以使用CSS。我知道这不是一个流行的解决方案,但它是一个选项:)
例如,创建管理样式表并添加以下内容将在页面标题下添加文本。只需调整课程post-type-page
body.wp-admin.post-type-page .wp-heading-inline:after {
content: "Here is some text";
display: block;
}
