-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Consolidate Navigation fallbacks logic between Editor and Front of Site via REST API #48698
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
Merged
scruffian
merged 110 commits into
trunk
from
try/use-dedicated-rest-to-get-nav-fallbacks
Apr 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
110 commits
Select commit
Hold shift + click to select a range
f8a66b8
Add Navigation REST class with fallback endpoint
getdave c7aa87f
Scaffold out tests
getdave 1115c7b
Add fallback creation method and tests
getdave 84a1af9
Add tests for returning existing Navigation posts
getdave c7d168f
Use Gutenberg versions of block functions
getdave 5ea9a22
Add classic meny and concurrent request assertions
getdave 24cfd94
Test does not create from classic if Navigation menu exists
getdave 13d33df
Test for page list being unavailable
getdave 13bb243
Extract common Nav fallback code into dedicated class
getdave b3d51a6
Remove changes to load
getdave 0ecd828
Move get recent navigation into common class
getdave 80ff0d9
Migrate functions to class and deprecate originals
getdave c1dd6f5
Refactor method to get fallback to exit early style
getdave e9f021d
Use new class in render_callback
getdave e85b9c8
Add example of dedicated class tests over REST endpoint tests
getdave 9befce9
Add example of refactoring editor code to use new API endpoint
getdave 38f3712
Update docblock
getdave 0576ade
Add permissions check and test
getdave 47ea683
Improve comments
getdave b0f19ce
Adjust test user
getdave 0686177
Revert removal of deprecated function bodies
getdave 7c39ed8
Reinstate deprecations
getdave 1a8cc32
Update editor notice
getdave aaada54
Update endpoint to singular form (fallback)
getdave 4649e99
Rename class to be specifically related to fallbacks and non generic
getdave 8668dec
Also update file names
getdave d10cdd0
Avoid returning unecessary WP_Error
getdave 6132be9
Avoid get_post and use performance internal method
getdave 4c152e4
Normalize functions to standardise signatures
getdave 457d390
Extract Menu parsing logic into separate class
getdave 4734199
Refactor classic menu fallback logic
getdave 1b750d5
Add test for Classic Menu in Primary Location
getdave e1cbab0
Add test for classic menu fallback to “primary” slug
getdave ad48992
Add further tests for classic menu fallback mechanic
getdave fd79656
Tidy
getdave f433cf2
Controller docblocks
getdave d5b54c4
Docblocks for WP_Navigation_Fallbacks_Gutenberg
getdave 8aa039f
Simplfy fallbacks sequence
getdave 4cf43ab
Tweak error slug
getdave 7037a38
Use array() syntax
getdave 2669c52
Improve function naming for clarity
getdave 4b3c1c9
Try to fix PHPCS errors and warnings
getdave be54021
Rename class
getdave 5f5341a
Correct return type
getdave 11d1b1b
Update naming for consistency
getdave f4ee89d
Extract function for default registered blocks
getdave 29a20c9
Corrects spelling in comment
getdave 321db0a
Use more appropriate assertion
getdave 2a9ffcf
Remove code references that no longer apply
getdave 6001581
Remove PHP based ordering.
getdave 1bba273
Rename class to match file
getdave cc075a9
Move to standalone block editor REST endpoint
getdave 9603ce8
Migrate all tests to the Domain class and remove from REST endpoint t…
getdave 7143798
Add smoke test to REST endpoint
getdave f8ef276
Augment smoke test to check for number of menus created
getdave eba41ce
Add schema and associated test
getdave f6082f9
Add useful comment
getdave 577b32d
Update editor logic to expect an ID from the REST endpoint
getdave 3479818
Correct return type
getdave 953a515
Add default domain to i18n
getdave c1657dc
Try to get the file docblock comment correct
getdave 449e2ee
Another file comment update
getdave 38a3a50
Update lib/experimental/class-wp-rest-navigation-fallbacks-controller…
scruffian 59c69c2
Update REST method naming to use `get_item`
getdave 00b83e4
Move method inline with main permissions check
getdave e8a6356
Ensure rest response for endpoint
getdave 0d29d95
Simplify perrmissions checks
getdave b1660fa
Add and translate error messages
getdave 5a53b92
Remove erroneous comment
getdave 1b18d69
Use static function
getdave 12ecaba
Add @covers notation
getdave b631518
Add messages to assertions
getdave b00ac6b
Add messages to all assertions
getdave 6037f45
Remove unused method
getdave de35df2
Update correct return type
getdave 2590732
Implement prepare_item_for_response
getdave 1f201d6
Revert to returning object in REST response
getdave 2d09c18
Adjust tests to assert on new return type
getdave b69b3f1
Add response context filtering
getdave 6ad35cc
Revert to `array` accidentally introduced in refactor
getdave 6277397
add an extra comment to keep the linter happy, maybe
scruffian 6f85821
Check fields before included them in response
getdave fa1b395
Improve test name
getdave f228b7e
Update e2e test to expect Page List fallback Menu to be auto-created
getdave 8b718cc
Revert fallbacks invocation to simplified method
getdave c9f3c05
Correct privacy on members of WP_Navigation_Fallbacks_Gutenberg
getdave 2c6bb93
Rename test and remove associated @doesNotPerformAssertions
getdave d5d6833
Remove unnecessary test for WP_Error
getdave b919057
Update comment
getdave 734d3e4
Minor comment rewording.
getdave 8a61e15
Remove unnecessary comments
getdave eed97ff
Reword comment to align with block terminology
getdave ccd235b
Improve comment wording.
getdave 2164b79
Remove some comments
getdave 1f715df
Rename classes with singular “fallback”
getdave 7794109
Extract conditional to var for clarity
getdave 9f213d5
Rename converter class
getdave 638f7e2
Fix comments in JS
getdave a2a8e3c
Add comments to improve clarity around fallbacks logic
getdave 308571f
Shorten method name to reduce verbosity
getdave eaceebe
Remove unnecessary comments from self documenting code
getdave d3b85da
Rename variables for clarity
getdave a3bf3be
Fix PHPCS
getdave 3238826
Make converter class static
getdave 191dd14
Improve var naming
getdave 09e1681
Ensure all assertions have messages
getdave 780bc12
Add @covers annotation
getdave 56f181b
Add links to the response
getdave da4cdb9
Add test for inclusion of links in Response
getdave db39cdb
Fix PHPCS
getdave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve comments
- Loading branch information
commit 47ea68319b8a4dfa2a2525ee5cb30a0543e31a78
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.