没那么难,你可以用all_admin_notices
-挂钩,显示在Post Updated/Saved
, 等消息框。
包装在插件中:
<?php
! defined( \'ABSPATH\' ) AND exit;
/** Plugin Name: (#64933) »kaiser« Add post/page note */
function wpse64933_add_posttype_note()
{
global $post, $pagenow;
// Abort in certain conditions, based on the global $pagenow
if ( ! in_array(
$pagenow
,array(
\'post-new.php\'
,\'post.php\'
)
) )
return;
// Abort in certain conditions, based on the global $post
if ( ! in_array(
$post->post_type
,array(
\'post\'
,\'page\'
)
) )
return;
// You can use the global $post here
echo \'<p>HELLO WORLD!</p>\';
}
add_action( \'all_admin_notices\', \'wpse64933_add_posttype_note\' );