Analytics 360 For Editors
Written by Erock
Friday, 21 October 2011 03:34
I wanted Analytics360 to be visible to the editors of a particular website. I found the appropriate threat on the net that explained it, and set about doing it. But then I noticed that the code had changed a bit since the last post, thusly making the workaround display the api settings page to editors (no good!). So, what I did, was change all instances of ‘manage_options’ to ‘moderate_comments’, inside analytics360.php but then I duplicated the function that created the menu, and put it and the original behind an IF/ELSE statement and removed the creation of the settings page in the appropriate place, and voila. settings page for admin, analytics page for admin and editors!..
The code to replace is the a360_admin_menu function in analytics360.php starting at line #635.. Replace that function with this modified function
function a360_admin_menu() { if (current_user_can('manage_options')) { add_options_page( __('Settings', 'analytics360'), __('Analytics360°', 'analytics360'), 'manage_options', basename(__FILE__), 'a360_settings_form' ); add_dashboard_page( __('Dashboard', 'analytics360'), __('Analytics360°', 'analytics360'), 'manage_options', basename(__FILE__), 'a360_dashboard' ); } else { if (current_user_can('publish_posts')) { add_options_page( __('Analytics360°', 'analytics360'), 'publish_posts', basename(__FILE__), 'a360_settings_form' ); add_dashboard_page( __('Dashboard', 'analytics360'), __('Analytics360°', 'analytics360'), 'publish_posts', basename(__FILE__), 'a360_dashboard' ); } } }
Categories
Archives
- Pro -Sites Shortcodes, Functions, And Level Checks
- Automatic WP Photo Gallery From Facebook Page Photos!
- Analytics 360 For Editors
- Add nofollow rel tags to image widget
- Image Widget Alignment Fix
- Add GD Star Rating next to Post Title
- Change The Buddypress Admin Bar Logo And Link In WP3 & BP 1.2+!
- New Dashboard Lockdown & WordPress To Buddypress Profile Page Plugin!
- Hide The WordPress Dashboard and wp-admin COMPLETELY!
- Blogs & Members Directory, Strange Nav Spacing FIX