Last active
July 18, 2018 11:01
-
-
Save baikaresandip/f2389741b19c75254a13bb945f8815cd to your computer and use it in GitHub Desktop.
Wordpress add short description on the custom post type page: The filter views_{$this->screen->id} is fired just after the title of post edit screen has been print to screen, so it's a safe place to just echo what you want. So you can simply do:
This file contains hidden or 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
<?php | |
function post_type_desc( $views ){ | |
$screen = get_current_screen(); | |
$post_type = get_post_type_object($screen->post_type); | |
if ($post_type->description) { | |
printf('<h4>%s</h4>', esc_html($post_type->description)); // echo | |
} | |
return $views; // return original input unchanged | |
} | |
add_filter("views_edit-POST_TYPE_HERE", 'post_type_desc'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment