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

Make custom_menu_order filter run later than WooCommerce #151

Merged
merged 1 commit into from Jul 23, 2018

Conversation

@alexsanford
Copy link
Contributor

alexsanford commented Jul 20, 2018

Fixes #126

See the issue for a description of the bug.

The bug was happening because WooCommerce was setting the custom_menu_order filter to return false for users who could not manage WooCommerce. This was causing the custom menu ordering for Sensei Certificates to stop working for non-admin users (i.e. Teachers).

This workaround causes our filter function to be run later than WooCommerce's function, meaning that custom_menu_order will be true.

I've also submitted a patch to WooCommerce which should cause this not to happen for other plugins.

Testing

  • Install WooCommerce.

  • Log in as an Admin user, and as a Teacher. In both cases, ensure that the Certificates menu item appears below the Lesson menu item.

WooCommerce was setting the filter to return false for users who could
not manage WooCommerce. This was causing the custom menu ordering for
Sensei Certificates to stop working for non-admin users (i.e. Teachers).
@alexsanford alexsanford added this to the 1.1.0 milestone Jul 20, 2018
@alexsanford alexsanford self-assigned this Jul 20, 2018
@alexsanford alexsanford requested review from jom and pgk Jul 20, 2018
@jom
jom approved these changes Jul 23, 2018
Copy link
Contributor

jom left a comment

LGTM! Tested and works well 👍

@alexsanford alexsanford merged commit 8a54dd4 into master Jul 23, 2018
@alexsanford alexsanford deleted the fix/menu-order branch Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.