In my custom plugin, I am using the following code to display an info / help box.
This is working great for the main admin edit screen that lists the custom posts, but how can I extend this to show the message at the top of each of the actual child custom posts too.
function my_admin_notice(){
global $pagenow;
if ($_GET['post_type'] == 'my_custom_post_type' ) {
echo '
<div class="updated">
<h3><strong>Help</strong></h3>
<p>some help text</p>
</div>';
}
}
add_action('admin_notices', 'my_admin_notice');
You’ll need to check the
$pagenow
variable and the post type of the post being edited. It will look something like this: