Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Analytics360 for Editors

By: brasofilo on Nov 17th, 2011  |  syntax: PHP  |  size: 1.20 KB  |  views: 187  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data