WordPress.org

Ready to get started?Download WordPress

Forums

WP-Click-Tracker
If you want only editors/admins to see dashboard statistics (2 posts)

  1. maxemil
    Member
    Posted 3 years ago #

    Note, this was done to Version 0.7.3.
    It really should be implemented to the plugin itself with an options panel :) - this is just a quick fix.

    Someone asked that subscribers/authors dont see the dashboard statistics.
    heres a way to disable the dashboard for non editors/admins:

    Edit the file "click-tracker.php"

    1: find the line
    "add_action('wp_dashboard_setup', 'wpct_admin_add_dashboard_widgets' );"

    2: insert two // before the line (making it not execute)

    3: paste the following code

    function wpct_admin_add_dashboard_widgets2()
    {
      if ( current_user_can('level_7') ) // editors and admins
      {
        wp_add_dashboard_widget('wpct_admin_dashboard_widget', __('Click Tracker', 'wp-click-track'), 'wpct_admin_dashboard_widget');
      }
    }
    add_action('wp_dashboard_setup', 'wpct_admin_add_dashboard_widgets2');

    Note that the last line is almost identical as the one you //'ed
    - The only thing we do here is to insert a check if the user is editor or admin.

    BR\Emil

    http://wordpress.org/extend/plugins/wp-click-track/

  2. jmayoff
    Member
    Posted 2 years ago #

    Thanks, I did this and it worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic