• Resolved spinozarabel

    (@spinozarabel)


    Greetings. First of all, thanks for an excellent plugin!
    The plugin works well and as stated and the issue is not with it.
    My issue is that, for non-admins, a previously hidden admin bar and dashboard gets unhidden for the sub-site where registration is enabled.
    Can you kindly point me to the specific location of code in your plugin that I can modify to prevent this?

    I use the following code to hide the admin bar, in my own plugin:

    function habfna_hide_admin_bar_settings()
    {
    ?>
        <style type="text/css">
            .show-admin-bar {
                display: none;
            }
        </style>
    <?php
    }
    function habfna_disable_admin_bar()
    {
        if(!current_user_can('administrator'))
        {
            add_filter( 'show_admin_bar', '__return_false' );
            add_action( 'admin_print_scripts-profile.php', 'habfna_hide_admin_bar_settings' );
        }
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Justin Fletcher

    (@justinticktock)

    Do you have your plugin Network Active ? or in the MU plugins ?
    or at least active on the sub-site where you want the admin hidden.

    Thread Starter spinozarabel

    (@spinozarabel)

    Ho Justin, thanks for your response.

    My plugin has been activated in the sub-site of concern where Registration is Enabled by your plugin.

    Interestingly, after login your plugin redirects to the user profile edit page with the admin dashboard showing.

    If I then go click on visit site, the admin bar disappears, like I would like it to be. However it reappears when I click on any menu item that needs wp-admin.

    So , if I could prevent the redirect to the edit user profile on login that is happening in your plugin and prevent showing any links that need wp-admmin, I should be OK.

    Plugin Author Justin Fletcher

    (@justinticktock)

    Hi again, the NSUR is only following the default WP registration path so the admin is the place that users go initial on registration. Assuming that you are not allowing the public to register new sites (as well has user accounts) then its a bit more simple and the following would work for you..

    To hide the admin bar from the front of your site for uses you can use plugins (like hide-admin-bar-based-on-user-roles).

    and for a redirect to a different page again you could use plugins (like peters-login-redirect).

    have you considered this approach, which would give you more flexibility.

    Plugin Author Justin Fletcher

    (@justinticktock)

    hi @spinozarabel how did you get on ?

    Thread Starter spinozarabel

    (@spinozarabel)

    Hi Justin,
    Thanks for the prompt. Your suggestion with a bit more custom code helped with this issue. Please close the ticket. Thank again for your plugin and for your excellent support. I will rate your plugin as 5*!

    Madhu

    Plugin Author Justin Fletcher

    (@justinticktock)

    Glad you got it working in the end ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Previously hidden admin bar/dashboard becomes visible’ is closed to new replies.