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

add_menu_page/admin_menu conflicts with other plugins. #37

Closed
mikemcguire opened this issue Jan 26, 2015 · 2 comments
Closed

add_menu_page/admin_menu conflicts with other plugins. #37

mikemcguire opened this issue Jan 26, 2015 · 2 comments
Assignees

Comments

@mikemcguire
Copy link

I was having issues where the menu page would not be linked inside of the admin navigation. In particular I found this issue was happening when ACF Pro was activated http://www.advancedcustomfields.com/ I tried to track down where the conflict was happening and found that if I prevented ACF from generating it's menu page the auth0 menu page link appeared.

Considering that ACF is one of the most popular plugins for wordpress I thought it would reasonable that both plugins should work together.

When comparing the method that each plugin creates it's admin page, I found that both plugins were in fact using the correct action "admin-menu" to hook into, but ACF has set it's priority and accepted arguments whereas wp-auth0 used the defaults.

Here is ACF's action

add_action('admin_menu', array($this,'admin_menu'), 99, 0);

And now wp-auth0's

add_action( 'admin_menu', array(__CLASS__, 'init_menu') );

If I add a priority to wp-auth0 of 99+ the conflict resolves itself. Or if I remove the priority argument from ACF the conflict resolves itself. I am not positive what is best practice here, to use the defaults or set a custom priority. I will post a duplicate issue one the ACF plugin github, so that hopefully these types of conflicts can be avoided.

@mikemcguire mikemcguire changed the title Conflicts with other plugins. add_menu_page/admin_menu conflicts with other plugins. Jan 26, 2015
@woloski
Copy link
Contributor

woloski commented Jan 26, 2015

thx @mikemcguire, we'll take a look

@glena
Copy link
Contributor

glena commented Jun 29, 2015

I set up a priority with decimals hoping it wont get overridden by other plugin.
It should be ready in the next release.
Thanks @mikemcguire

@glena glena closed this as completed Jun 29, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants