Advertisement
brasofilo

Analytics360 for Editors

Nov 17th, 2011
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <?php
  2. /*
  3.     Based on: http://erikshosting.com/wordpress-tips-code/analytics-360-for-editors/
  4.     Usage: change this function in analytics360.php around line #635..
  5.     Backup: you can rename the old function to a360_admin_menu_old()
  6.             and simply add the new one instead of replace it
  7.  
  8.         Addendum: in function a360_request_handler() - line #210,
  9.                     change "manage_options" to "publish_posts"
  10. */
  11. function a360_admin_menu() {
  12.     if (current_user_can('manage_options')) {
  13.         add_options_page(
  14.             __('Settings', 'analytics360'),
  15.             __('Analytics360°', 'analytics360'),
  16.             'manage_options',
  17.             basename(__FILE__),
  18.             'a360_settings_form'
  19.         );
  20.         add_dashboard_page(
  21.             __('Dashboard', 'analytics360'),
  22.             __('Analytics360°', 'analytics360'),
  23.             'manage_options',
  24.             basename(__FILE__),
  25.             'a360_dashboard'
  26.         );
  27.     } elseif (current_user_can('publish_posts')) {
  28.         add_options_page(
  29.             __('Analytics360°', 'analytics360'),
  30.             'publish_posts',
  31.             basename(__FILE__),
  32.             'a360_settings_form'
  33.         );
  34.         add_dashboard_page(
  35.             __('Dashboard', 'analytics360'),
  36.             __('Analytics360°', 'analytics360'),
  37.             'publish_posts',
  38.             basename(__FILE__),
  39.             'a360_dashboard'
  40.         );
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement