Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Toolbar Frontend #16

Closed
renatonascalves opened this issue Aug 9, 2017 · 12 comments
Closed

Remove Toolbar Frontend #16

renatonascalves opened this issue Aug 9, 2017 · 12 comments

Comments

@renatonascalves
Copy link

Not sure if that's the intention but if I set up to show the tool bar in the user profile: intervention('remove-toolbar-frontend'); has no effect.

I presume it would overide what a user might add there.

@darrenjacoby
Copy link
Owner

Thanks, will take a look at this.

@darrenjacoby
Copy link
Owner

@renatonascalves

I can confirm it's working on my end, could you provide more information? You could try run this function within your functions.php to debug and see if it works?

add_filter('show_admin_bar', '__return_false');

The module for this function is very basic—
https://github.com/soberwp/intervention/blob/master/src/Module/RemoveToolbarFrontend.php

@renatonascalves
Copy link
Author

@darrenjacoby Hi!

If you add the mentioned one above, it works. If I remove the above and add in intervention one, it doesn't work as expected. :/

@darrenjacoby
Copy link
Owner

@renatonascalves could you try with the intervention function and specify an user role?

eg.
intervention('remove-toolbar-frontend', 'administrator');

(depending on the user role, or is it perhaps a custom user role you're using?)

@renatonascalves
Copy link
Author

renatonascalves commented Aug 21, 2017

Sorry! Forgot to come back and provide my feedback. That error still exists.

It seems user settings takes precedence. The same doesn't happen if one uses the function without checking the user role though.

@darrenjacoby darrenjacoby reopened this Aug 26, 2017
@darrenjacoby
Copy link
Owner

darrenjacoby commented Aug 26, 2017

@renatonascalves

I'm still unable to replicate. Could you provide more information? Perhaps a GitHub link to the project?

Are you perhaps using a custom user role? Do other modules work as expected that require user roles?

@renatonascalves
Copy link
Author

renatonascalves commented Aug 26, 2017

Strange! Really strange! I tried these:

intervention( 'remove-toolbar-frontend');
intervention( 'remove-toolbar-frontend', 'editor' );
intervention( 'remove-toolbar-frontend', 'administrator' );

None of them work. Only when I add like that: add_filter( 'show_admin_bar', '__return_false' );

@darrenjacoby
Copy link
Owner

That is strange. If you could provide a link to the project I could try debug from there. Just to ask, are the other modules working (that have user role options) ?

@darrenjacoby
Copy link
Owner

darrenjacoby commented Sep 1, 2017

@renatonascalves

Just checking in here? I would like to resolve so that I may close the issue.

@9585999
Copy link
Contributor

9585999 commented Sep 1, 2017

Works for me.

Option in the admin panel is enabled, the toolbar is not displayed in the frontend.

@darrenjacoby
Copy link
Owner

Same, I haven't been able to replicate no matter what I've tried.

@renatonascalves
Copy link
Author

@darrenjacoby I decided to keep using add_filter( 'show_admin_bar', '__return_false' ); I can't make it work with the intervention one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants