Make the LifterLMS menu meta box initially available on Appearance -> Menus#2333
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@chrisbadgett asked me to look into how to make the LifterLMS meta box available/visible by default under Appearance -> Menus, without the need of enabling it via Screen Options.
This PR allows that. Of course it will only apply to new users from now on, as for older users who already opened that page WordPress already saved the hiding of that item as user "preference".
More in depth description:
https://developer.wordpress.org/reference/functions/wp_initial_nav_menu_meta_boxes/
metaboxhidden_nav-menusis not set, so only the defined initial meta boxes are displayed:$initial_meta_boxes = array( 'add-post-type-page', 'add-post-type-post', 'add-custom-links', 'add-category' );global $wp_meta_boxes) that have been added until that point are marked as hidden, and the list of the hidden meta boxes is saved into the optionmetaboxhidden_nav-menus., so next time they won't be shown. This option can be altered then via the Screen Options on that Appearance -> Menus page.wp_initial_nav_menu_meta_boxes()has run, so our meta box won't be part of theglobal $wp_meta_boxesseen by that function, so it won't be automatically marked as hidden, while prior to this PR the meta box addition would run beforewp_initial_nav_menu_meta_boxes(), so the added meta box would be marked as hidden and saved as such.(the new hook is the same hook used by WooCommerce for the same purpose)
How has this been tested?
manually, creating a new (administrator) user and switching to it.
Screenshots
Types of changes
UX improvement?
Checklist: