/ Published in: PHP

Clients often expect full administrative access (and rightly so), including access to settings pages. Let’s look at how we can hook admin “notices†(those warning boxes generated by some plug-ins) to send some warnings to administrative users when they are on settings pages.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Admin Settings Page Warning */ add_action( 'admin_notices', 'my_admin_notice' ); function my_admin_notice(){ global $current_screen; ?> <div> <?php if ( $current_screen->parent_base == 'options-general' ) echo '<div style="background-color:lightYellow;padding:10px;margin-top:20px;border-width:1px;border-style: solid;border-color:#E6DB55;padding: 0 .6em;margin: 5px 15px 2px;-moz-border-radius: 3px;-khtml-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;"><p>Warning - changing settings on these pages may cause problems with your website\'s design!</p></div>'; }
Comments
