PURPOSE: Hide the ‘Lazyest Gallery’ menu item from WordPress admin panel Dashboard for everyone but the administrators. This doesn’t hide the entire ‘Lazyest Gallery’ menu item, but it does remove the “edit Gallery” pages. The result is that your subscribers, contributors, authors, and editors will not be able to edit your gallery, nor delete your pictures. With the default settings on the plugin, your contributors have access to the edit the gallery, even delete pictures by accident. While it can be useful to give access to those user levels, you don’t always want to give that access.
This is useful if you don’t want registered users to be able to edit your gallery.
And now the code:
FILE TO MODIFY:
wp-content/plugins/lazyest-gallery/inc/admin.php
LINE TO MODIFY: LINE 105
THE CHANGE TO MAKE IS THIS:
One line 105, you’ll see an ‘add_menu_page’ functions. The third parameter of that functions is ‘read’. Change it from ‘read’ to ‘activate_plugins’. That’s all.
If you prefer to cut and paste instead, do this. Find the following code, which should be line 105:
$filemanager_page_hookname = add_menu_page( __('Lazyest Gallery'), __('Lazyest Gallery'), 'read', 'lazyest-filemanager', array( &$this , 'filemanager_page' ), path_join( $this->plugin_url, 'images/file-manager.png' ) );
and replace it with this new code:
$filemanager_page_hookname = add_menu_page( __('Lazyest Gallery'), __('Lazyest Gallery'), 'activate_plugins', 'lazyest-filemanager', array( &$this , 'filemanager_page' ), path_join( $this->plugin_url, 'images/file-manager.png' ) );
Questions and Comments are Welcome