Frank Grafenstein
February 15, 2013 at 4:01 am
Trying to disable update notifications for my regional eventmanagers using the following code in theme functions.php failed:
function filter_plugin_updates( $value ) {
if(!current_user_can(‘administrator’)) {
unset( $value->response[‘eventespresso.tmp/espresso.php’] );
return $value;
}
add_filter( ‘site_transient_update_plugins’, ‘filter_plugin_updates’ );
How to hide EE-update notifications from non-administrator users?
Thanks
Frank
Dean
February 17, 2013 at 11:34 pm
Add New Note to this Reply
Hi Frank,
Not sure if what you are trying there will work. The function in question isnt pluggable nor is there an action hook assigned to it.
The best thing I can come up with is a function to add to the themes functions which adds a css rule to the message so if not admin hide
function remove_pu() {
if(!current_user_can('administrator')) { ?>
<style>
#pu_dashboard_message { display:none; }
</style>
<?php }
}
add_action('admin_footer', 'remove_pu');
This worked fine with my tests on Event Managers.