Version 1.0

WP Hide Dashboard version 1.0 was released on 10/20/2008 for WordPress 2.6.2.

Description: This plugin removes the dashboard link and prevents access to the dashboard for users assigned to the Subscriber role. This is useful if you want to allow your subscribers to edit their own profiles, but don't want them wandering around the rest of your WordPress admin section.

Users belonging to any of the other WordPress roles will continue to see the dashboard link and have dashboard access that corresponds to their role's capabilities.

Screenshot:

WP Hide Dashboard, Version 1.0
Screenshot of the upper-left portion of admin section

Note: Comments are closed for this version. Please update to the latest version of the plugin and post comments/questions on the page for that version.

5 Responses to Version 1.0

  1. Good plugin, but I did have to make a minor tweak to get it working. I'm very new to WordPress (using version 2.6.5), so it's entirely possible that I did something wrong. In any case, here is the change I made. Maybe it will benefit someone else...

    I replaced this line:

    if ($current_user->wp_capabilities['subscriber'] == 1) {

    With this one:

    if (!current_user_can('level_1')) {

    Before making that change, the redirect wasn't happening at all for "subscriber" users. It appears the $current_user->wp_capabilities array is either missing or empty in my setup, but the "current_user_can" function works fine.

    • Kim says:

      Michael: I would encourage you to try and help me troubleshoot why the plugin isn't working for you using the existing plugin code.

      Have you tried creating a dummy account, assigning it to the Subscriber role, and logging in to that account to verify what happens when the plugin is activated?

      While your change does work, levels are deprecated in WordPress, but are still in the core to maintain backward compatibility with older plugins. All new core capabilities are based on roles, not levels, and plugin authors are encouraged to develop plugins using Roles and Capabilities rather than levels.

      wp_capabilities is part of the wp_usermeta database table, and is there by default when you install WordPress, so you should have that. You need to check that table via phpMyAdmin, click "Browse" and sort the results by the meta_key column, and see how many rows you have for wp_capabilities where the role is "subscriber" (meta_key: wp_capabilities/meta_value: a:1:{s:10:"subscriber";b:1;}). Let me know what you find out please.

      • Hi Kim,
        I'd be happy to help. I did create a dummy account, but when I log in with it, I still get taken directly to the dashboard. This is the same thing that happens without the plugin.

        I see 3 rows for wp_capabilities: 2 with a:1:{s:13:"administrator";b:1;} and 1 with a:1:{s:10:"subscriber";b:1;}. This is correct, as I created 2 admins and 1 dummy account. The user_id of the "subscriber" capability does correspond with the dummy account in the wp_users table.

        Let me know if there's any other information I can gather for you.

        • FYI... I just installed the new WordPress 2.7, and I still have to use my little hack to make the plugin work properly. The good news is that with the hack, it IS working with WP 2.7 :)

          • Kim says:

            Michael:

            1. Is this a fresh WP 2.7 install?

            2. What other plugins are you running with this WordPress install? I'm wondering if there isn't a plugin that is conflicting with mine.

Comments are closed.