I kind of feel like I’m missing something obvious, but maybe I’m not. What about the admin_notices
hook, seems like the obvious choice to me. There are some admin CSS classes available you can use, like updated
, error
or update-nag
, or you can of course add your own styles, like asked and answered here or here.
Code:
<?php
function my_cpt_info() {
if ('edit-my_cpt' === get_current_screen()->id) {
?>
<div class="updated">
<p>
<?php _e('Some information about my CPT...', 'my-text-domain'); ?>
</p>
</div>
<?php
}
} // function my_cpt_info
add_action('admin_notices', 'my_cpt_info');
?>
Related Posts:
- Exclude drafts in all() view of edit.php
- WordPress Delete hook with wp_delete_post function?
- Custom Theme Want To Remove One Category From All Displays
- I am unable to publish/update post
- Adding buttons to Add New Post and Add New Page
- issue in wordpress auto delete post and redirect to another 1
- wp query custom orderby not custom field
- Checking if some condition is matched before inserting post into database
- Get old values for post before saving new ones
- how to limit edit_form_after_title hook to page and post edit only?
- Add a checkbox to post screen that adds a class to the title
- Attach pdf file to custom post type
- Count singular post views automatically
- Delete Post Link to delete post, its meta and attachments
- Make “Post published. View post” Open in a New Tab
- Filter post before *editing*
- Add custom field to category of custom post type
- Add confirmation popup on “Move to Trash”
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Add filter-by-tag in the all posts admin console page
- Add custom fields to post programmatically
- display list of posts/pages in admin edit post/page
- Is it possible to have two different previews of a post (ie. two templates for one post)?
- Invalid post type when click “Filter” or “Apply” button in WordPress admin Post list [closed]
- Filter Posts By Tag
- How to show featured image in custom post type dashboard post page
- Dynamic carousel on individual posts
- Set terms in a custom post
- I want to display custom text widgets for each post in the sidebar?
- Display posts styled exactly like default posts
- Which WordPress hook fires after post content loaded?
- Classic editor throws 403 error based on post content
- Move first half of posts to one parent page, second half to the other page
- Custom loop pagination links not working
- Enable Comments Box On Custom Post Type
- How to access $post from a callback function
- How can i limit the number of posts created per category?
- Responsive images with custom image size
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- Admin – create custom post status and display above table
- show custom post type category dropdown sorting result on same page
- plugin to post from admin to flickr [closed]
- Call Web Services on post first publish
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- Customize rel=canonical tag for single blog post
- disable Tab post on nav-menus page (Admin)
- What does WordPress do if I save a post without content/title? [duplicate]
- Adding bootstrap classes to video shortcodes
- Best Way to Add UnEditable HTML to Posts
- How safe is it to delete old posts edits to save database space?
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Divs appearing everywhere in post content
- Is codex right on deleting post?
- How to get the old WordPress Draft Editor view back with the Word count?
- How to get different Related Posts
- l accidentally permanently deleted a Draft. There’s any way I can recover it?
- Inserting an example of the last 3 post on to the homepage
- Can WordPress handle following functionalities?
- Get a term each custom post type
- Lightbox on wordpress post page
- Getting post and attached image from subdomain
- Trying to exclude custom posts based on date, while sorting by custom field
- Help on conditional statement to accompany wp_insert_post function please?
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- Posting to WP via URL
- Alt text attributes not showing over portfolio images
- Adding an option to post editor to show a site disclaimer or message
- Search results for ACF data
- Blog open in new Tab
- Redirect to custom post if custom archive page has just one result?
- Get Category in save_post Hook
- Strange behaviour in WordPress admin
- Count singular post views automatically
- Multiple posts in one page
- delete post hook not being fired when deling in wordpress dashboard admin
- WordPress Delete Users from backend doesn’t work
- Is it possible to make a custom post that adds multiple pages?
- Custom post styling per category?
- How to sort posts in admin by name
- Custom post type – Loop out in random order but same 15 to appear first… still random
- Is it possible to display QUICK EDIT as default for all posts in wp-admin/edit.php page?
- Hook To Get All Posts Deleted
- Meta boxes not saving
- Custom URL Structure for posts with subcategories
- Help with a function that will place a map pin for all posts
- How to show the posts list into a static page? Problems to use the loop into a static page
- Allow users to create their own page/s
- 404 for some custom taxonomy not ALL taxonomy
- Add default content to post (for specific category)
- Setting default category for display
- WordPress strips some attributes for author posts
- Display one post randomly from category on home page
- save_post not working
- Deleting first four characters from all Post Titles
- Deleling wordpress posts permanently still have IDs
- Post’s arent displaying
- Can I get custom post items in select box (dropdown)
- How to have 2 posting pages on a blog
- Notify/check if the content of a custom gutenberg block has changed on save_post