Skip to content

Instantly share code, notes, and snippets.

@nfsarmento
Created May 21, 2018 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfsarmento/187404a41cbfd8e4c20b96ed2932843e to your computer and use it in GitHub Desktop.
Save nfsarmento/187404a41cbfd8e4c20b96ed2932843e to your computer and use it in GitHub Desktop.
Add information above a custom post type listing of all posts page
function wpa_admin_notice() {
$screen = get_current_screen();
if( 'your_post_type' == $screen->post_type
&& 'edit' == $screen->base ){
?>
<div class="updated">
<p>Here is some text</p>
</div>
<?php
}
}
add_action( 'admin_notices', 'wpa_admin_notice' );
## Change your_post_type to whatever your custom post type slug is.
## Also see get_current_screen on https://codex.wordpress.org/Function_Reference/get_current_screen for more info on that function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment