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
- sortable custom column in media library
- stop redirection on /wp-admin call to /wp-login
- Set “Display name publicly as” to be usernames by default
- How to disable admin flyout menus?
- Increment Page Order As Pages Are Created
- How can I set up multi language admin ui?
- Change Dashboard url
- WordPress subdomain wp-admin redirects to main domain
- CDN + WP Admin Query – .htaccess redirection
- Users Unable to Access Dashboard/Posts/Pages
- WordPress 3.2 Admin UI Guide
- Password reset link becomes invalid immediately [closed]
- WordPress and bbPress Login conflicts?
- How can I use a variable to include a linked image?
- Add css code in admin_enqueue_scripts
- Why isn’t my email showing up as registered with WordPress anymore?
- Unable to locate WordPress Root directory
- redirect to a dedicated sign in page
- 404 redirect wp-login and wp-admin after changing login url [closed]
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- More than one admin logged in?
- How do I let logged out users see the dashboard?
- Remove Permalink From Admin Edit Post
- load-{$page hook} and returned parameter
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- Making Comments, a sub_menu in admin menu
- Without using wordpress cms Is it possible to signup from my html page
- GoDaddy hosting wp-admin problem
- Publish page by invoking submit via jQuery
- Add custom fields to a page template, admin side
- Error messages & can’t reach admin after upgrading to 3.4.1 WordPress
- Wp-Admin FTPS Connection Error unlike Filezilla
- Newly created user role not displaying on users screen
- Could not override the url in wp-config file
- WordPress Migration Post Problems
- How to remove the color picker code from users-edit.php
- wp-admin and wp-login.php not Accessible after Cloudflare
- Many buttons not functioning in WordPress dashboard (as admin)
- Get rendered HTML of Page in Admin Area
- Having SSL enabled on admin, but disabled on post preview and live preview?
- Strange URLs admin area bug
- Google flagged a wp-admin redirect as phishing
- Problem with admin columns
- Edit is changing my custom’s post type parent id
- Checkbox not showing as checked on UserProfile (even with checked=”checked”)
- Added fields in quick edit screen need to update at the moment
- Custome column sort by date not title
- Modify admin panel tab position
- No HTML/Visual mode option in admin panel (New Post)
- Removing Author name
- No wp-admin, wp-config, or .htaccess folder/file
- Taking over a WordPress site
- LinkControl not showing suggestions when used on admin page