Created
July 24, 2022 00:01
-
-
Save SitesByYogi/3b16dbf5e6273cd26f4657c5db97079c to your computer and use it in GitHub Desktop.
Adds an admin notice to the top of page or post editor
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
// top message | |
add_action('all_admin_notices','top_message'); | |
function top_message() | |
{ | |
if(strpos($_SERVER['REQUEST_URI'],'post-new')>0 || strpos($_SERVER['REQUEST_URI'],'post.php')>0) | |
{ | |
echo (" | |
<div style=' background:#d3d3d3; width:95%; font-weight:bold; border:2px solid #AAA; | |
border-radius:7px; padding:20px; margin: 0 auto 0 auto ; margin-top:10px; '> | |
<div style='margin-bottom:20px; '> | |
Learn how to build better pages and post<a href='https://wpnfinite.com/blog' target='_blank'> here</a>. | |
</div> | |
</div> | |
"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment