Not really, since there’s not a setting on usermeta that says ‘This ID is an admin’ – The admins are a per-site settings.
You could do something like this: http://wplifeguard.com/how-to-add-custom-alerts-to-a-wordpress-dashboard/
And I think there are plugins out there that do that too.
Thread Starter
ajcke
(@ajcke)
Thanks! The custom alerts says it’s multisite capable, but the code provided says to add to the theme’s function file. Am I missing something? I haven’t found any plugins for this.
With my WordPress multisite I need to be able to alert subsite admins with updates and changes.
Put it in a file in your mu-plugins folder 🙂
Thread Starter
ajcke
(@ajcke)
I’ve never created my own file for the mu-plugins folder before. Can I create a file called whatever.php and place a code solution from http://wplifeguard.com/how-to-add-custom-alerts-to-a-wordpress-dashboard/?
Thread Starter
ajcke
(@ajcke)
I added a file called admin_alert.php to my mu-plugins directory and put the following code in it. When I refresh the site page the page displays white in FF and I get an unknown server error in Chrome.
<?php
if (current_user_can('administrator')) {
function addDashboardAlert() { ?>
<script type="text/javascript">
$j = jQuery;
$j().ready(function(){
$j('.wrap > h2').parent().prev().after('<div class="update-nag">This is a test alert for admins only. Do with it what you want.</div>');
});
</script>
<?php } add_action('admin_head','addDashboardAlert');
}
?>
Thread Starter
ajcke
(@ajcke)
I tried the first code on wplifeguard’s site and it works. Any idea to why the alert based on user level does not work (code above)?