Created
May 21, 2018 16:21
-
-
Save nfsarmento/187404a41cbfd8e4c20b96ed2932843e to your computer and use it in GitHub Desktop.
Add information above a custom post type listing of all posts page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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