-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix/wizard admin menu priority 3 #3544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all the discussions and tackling this! It's a nice and comprehensive solution. I left a non-blocking suggestion there, feel free to merge if you disagree.
includes/wizards/class-wizard.php
Outdated
/** | ||
* Priority for when 'add_page' callback fires. Default is WordPress's default hook priority of 10 | ||
* Override this on a per-wizard basis if there is a need to adjust the order that 'add_page' fires. | ||
* Example: set priority < 10 so add_page is called before other pages. Or > 10 so it's called after other | ||
* pages or plugins are loaded. | ||
* | ||
* @var int. | ||
*/ | ||
protected $add_page_priority = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember we thought of submenu_priority
here, but I like this idea better. Following the same logic, the priority is applied to the admin_menu
hook, so perhaps it should be called admin_menu_priority
. WDYT? This is non-blocking, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I kept going back and forth... $admin_menu_priority
is closer to what I had in original PR. Updated.
@jaredrethman FYI. If you notice any issues with advertising/sponsors let me know. Thanks! |
All Submissions:
Changes proposed in this Pull Request:
The original wizards code in
trunk
gave us the ability to adjust the priority of a wizard'sadd_page
callback. Somewhere in the timeline of theepic/ia
development, this ability was hard-code then removed around the time we were fixing the parent menu custom ordering. In the end, after attempt 1 and attempt 2, and lots of discussion, testing and a huddle with @miguelpeixe - we've settled on this PR in order to reinstate the removed code.Changes:
$parent_menu_order
.$add_page_priority
.newspack
parent menu was changed to$this->parent_menu
so wizards can control which parent menu they are added to.How to test the changes in this Pull Request:
epic/ia
.npm run build
if you haven't already forepic/ia
.Other information: