I wouldn’t use that hook. Here’s why
Try something like this using admin_notices.
function wpsites_admin_notice() {
$screen = get_current_screen();
if( 'post' == $screen->post_type
&& 'edit' == $screen->base ){
?>
<div class="error">
<p><?php _e( 'Updated Demo Message!', 'wpsites' ); ?></p>
</div>
<?php
}}
add_action( 'admin_notices', 'wpsites_admin_notice' );
Untested.
Related Posts:
- ‘wp’ hook supposed to trigger when editing a post?
- How to remove items from +New admin menu?
- Remove “From computer” media tab for posts with existing attachments?
- Restrict access to admin but allow admin_post hook
- Unwanted redirect in admin area
- Too many datadabse connections – upper ceiling mysql
- How to get the password and username of the add new user form (admin back end) in wordpress
- TinyMCE Autoresize
- Adding body class to login page?
- 500 Internal Server Error after Register dialog, but with successful registration
- How to change how long items are kept in the trash?
- Admin first hook that outputs HTML?
- WP Database Error (Windows Server 2008 & SQL Server)
- Display $pagenow error notice on all admin pages
- Can I edit the wp_post > post_content right before its inserted/updated?
- How to check if upload window came from the featured image link?
- How To Reset Ownership And Permissions of Wp-Content Folder, In Order to Fix HTTP Error When Uploading Images to WordPress Media Library
- How to create a WP Admin user in phpMyAdmin for WordPress 4.6
- Classic editor throws 403 error based on post content
- Wp-admin is giving me an error “Sorry, you are not allowed to access this page.”. I do have access to the wp-admin besides the dashboard itself
- is_admin() not working when updating a post in the admin panel
- wp-admin 302 redirects
- edit.php alter links
- Can I hook into wp_update_core outside of the admin?
- class-wp-hook.php on line 288
- Detect Featured Image remove while editing post in wp-admin (client-side)
- Cannot log in to the admin, no error message [closed]
- Restrict access to admin-post.php
- How do I add something to the “Edit Tag” page in wp-admin?
- Uncaught SyntaxError: Unexpected Token Illegal
- Pages section (only) not loading after publishing large number of pages
- How do I fix wp-admin error when exporting reusable blocks?
- Add HTML to custom post type edit page
- admin_post_nopriv_{$action} is secure?
- WordPress critical error on wp-admin page with 100% permissions
- Unable to access my page or WP Admin
- Cannot access wp-admin after migration to another place
- mixed contents admin panel is Unsecured
- How do I fix the 403 error for wp-admin/admin-ajax.php?
- Failed to load resource: the server responded with a status of 431 ()
- Conditions for admin get_current_screen action parent_file edit.php?post_type=page
- WordPress logged in but no access to wp-admin
- Can’t log into WordPress after domain change
- plugin: ‘init’ hook, check if we’re not in admin
- Non Object Notice Error – How to fix please
- WordPress blog fails to open
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Error 403 on wp-admin – Redirection to upgrade.php
- How to prevent a user from updating other users in WordPress?
- Making WP Admin Folder accessable JUST under a different link
- Is it possible to change the images source that are shown in the admin side?
- Is it possible to load an admin page inside a thickbox?
- Weird admin area
- Using query string on edit CPT page
- is_admin() triggers error
- add_post_meta displays in admin edit area
- Renaming child-theme folder fixed wp-admin blank
- Unable to access dashboard (wp-admin) only
- disable publish button until condition is not met
- How to Filter in the “Add Media Popup” to show only “unattached” Media
- Which hook should I use for this scenario regarding the registration process and account/profile update?
- How to display product category’s individual product list in shop page?
- Plugin (smart archives reloaded) crashed site / no access on admin panel
- Change permalink when page category selected in admin
- Why would running an admin check throw a 500 error? I’m calling is_super_admin();
- Forcing WordPress Administration onto a separate SSL Host
- $current_screen if condition for a specific page in admin
- is_admin() conditional statement
- Change event firing in wordpress
- Images on admin backend not showing up
- Customize a WP_Posts_List_Table class
- WordPress Admin: open popup window on a custom button
- How to hook into publish_posttype?
- Modify admin panel tab position
- Working with post values in the admin panel
- admin_print_styles incuding $_SERVER[‘DOCUMENT_ROOT’]
- No HTML/Visual mode option in admin panel (New Post)
- WordPress br in content problem
- I am not able to enable jQuery in theme settings
- How to troubleshoot 404s in WordPress admin
- WordPress loop in post admin view
- How to restrict user to see his comments only and admin can see everyone comments?
- How to prevent Google adsense invalid impressions while performing admin tasks on my wordpress site?
- Launch wordpress site to local computer from live website backed-up
- Admin Login page not working at all
- Admin Scripts enqueue codes seems ok but not working
- admin-post.php results on white screen after form submission
- CSS not showing up in my website Only HTML Displaying
- Can’t toggle between Visual and Text or Screen Options
- wordpress login blank screen [closed]
- Action for opening edit page in admin?
- Cannot Update wp DB – Get 500 Error
- Change height of Add New Post input box
- How can visitors redirect wp-admin to the homepage?
- Removing Author name
- Creating your own options-general.php page
- Anyone Can Register
- Hook with jquery script is not working in wp-admin [closed]
- How do I unset all of the select boxes for pages
- Admin panel: Javascript not loading properly. Cannot edit pages/posts [closed]