-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use first non-empty Nav post as primary fallback for Nav block (#36740)
* Use non-empty Nav post as fallback * Remove code duplication Addresses #36740 (comment) * Extract finding non empty nav block to function * Extract process of getting fallback to dedicated function * Apply block prefix to functions * Add additional safety check around parsing Nav blocks * Extract function for removing null blocks and apply * Check for empty parsed Nav blocks * Improve function comment Addresses #36740 (comment) * Amend ordering params to approximate current wp_nav_menus behaviour * Fetch Nav posts in query rather than filtering in memory Implements suggestion from #36740 (comment) * Improve comments * Spacing * Limit Nav Posts query to a single item Co-authored-by: Adam Zielinski <[email protected]> * Fix linting * Improve function naming Co-authored-by: Adam Zielinski <[email protected]> Co-authored-by: Adam Zielinski <[email protected]>
- Loading branch information
Showing
1 changed file
with
84 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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