-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Rest API: rename navigation fallback classes from WP_ to Gutenberg_ #51959
Conversation
… to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead.
…ock_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php
…oid compat errors and hopefully some confusion later.
WP_REST_Navigation_Fallback_Controller
class has been committed…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.
Thanks @ramonjd.
Looks like this is the approach other gutenebrg REST classes take, and tests are passing, so looks good to me!
I merged this with a failing performance test. That test checks out |
Thanks for handling this. So for my reference:
Question: is this documented? If not where could I contribute a docs update? |
Hi @getdave No worries. You've got it spot on. This document covers most of this, though not as succinctly as you've put it: https://github.com/WordPress/gutenberg/blob/trunk/lib/README.md Probably needs updating to include classes etc |
This seems to say the opposite of what I said above. Perhaps it should say use |
Oops, that document says:
So you were just following orders :) This probably needs to be cleared up. During release I don't think it's practical to juggle consistencies between plugin and Core where both have 🤷 Sorry for the confusion. Despite that doc I think experience has led us to the I'll add a note to raise it with @noisysocks |
I just cherry-picked this PR to the release/16.1 branch to get it included in the next release: 5a32952 |
…51959) * The `WP_REST_Navigation_Fallback_Controller` class has been committed to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead. * Renamed WP_Classic_To_Block_Menu_Converter to Gutenberg_Classic_To_Block_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php * Renamed all 6.3 classes to have the Gutenberg_ prefix. This should avoid compat errors and hopefully some confusion later. * Also rename test files for completeness * Updated deprecation notices to refer to Gutenberg classes
…51959) * The `WP_REST_Navigation_Fallback_Controller` class has been committed to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead. * Renamed WP_Classic_To_Block_Menu_Converter to Gutenberg_Classic_To_Block_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php * Renamed all 6.3 classes to have the Gutenberg_ prefix. This should avoid compat errors and hopefully some confusion later. * Also rename test files for completeness * Updated deprecation notices to refer to Gutenberg classes
* Restore sidebar in focus mode on Pattern click through in Browse Mode Library (#51897) Brings back #51492 * [Command center]: Add preferences and keyboard shortcuts commands (#51862) * [Command center]: Add preferences and keyboard shortcuts commands * update labels * [Site Editor]: Fix `library` command path (#51837) * Updating social link attributes (#51997) * Try: Update template titles (#51428) * Update template titles * Fix typo Co-authored-by: Alex Stine <[email protected]> * Revert Index rename * "front page" -> "homepage" * Update 404 Page make more sense given the template appears in the Pages panel too. * Front Page * home title + description * Revert Home name change, and move compat files * separate code for wp versions * update tests --------- Co-authored-by: Alex Stine <[email protected]> Co-authored-by: ntsekouras <[email protected]> * Update text color (#51965) * Modal: Add small top padding to the content so that avoid cutting off the visible outline when hovering items (#51829) * Site Editor: Fix focus cutoff in add template modal * Add padding-top to the modal content * Remove unnecessary padding-top * Remove unnecessary padding-top * Update changelog * Revert top padding from block patterns list * Revert top padding from block patterns list * Remove unnecessary changes * Remove unnecessary changes * Add CSS inline comment * Change padding metrics * Rest API: rename navigation fallback classes from WP_ to Gutenberg_ (#51959) * The `WP_REST_Navigation_Fallback_Controller` class has been committed to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead. * Renamed WP_Classic_To_Block_Menu_Converter to Gutenberg_Classic_To_Block_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php * Renamed all 6.3 classes to have the Gutenberg_ prefix. This should avoid compat errors and hopefully some confusion later. * Also rename test files for completeness * Updated deprecation notices to refer to Gutenberg classes * Fix phpunit failures (#51950) * Fix phpunit failures * Add comment * Update comment with actual reason this fix works --------- Co-authored-by: Dave Smith <[email protected]> Co-authored-by: Nik Tsekouras <[email protected]> Co-authored-by: Ramon <[email protected]> Co-authored-by: James Koster <[email protected]> Co-authored-by: Alex Stine <[email protected]> Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Robert Anderson <[email protected]>
…ordPress#51959) * The `WP_REST_Navigation_Fallback_Controller` class has been committed to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead. * Renamed WP_Classic_To_Block_Menu_Converter to Gutenberg_Classic_To_Block_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php * Renamed all 6.3 classes to have the Gutenberg_ prefix. This should avoid compat errors and hopefully some confusion later. * Also rename test files for completeness * Updated deprecation notices to refer to Gutenberg classes
What?
Renames
/compat/wordpress-6.3/class-wp-rest-navigation-fallback-controller.php
/WP_REST_Navigation_Fallback_Controller
and associated classes/filenames to theclass-gutenberg-*
andGutenberg_*
conventions.Why?
The
WP_REST_Navigation_Fallback_Controller
class has been committed to core and therefore results in a naming conflict and unit test failures.By renaming to
Gutenberg_*
we can avoid naming conflicts while still supporting 6.3 functionality in the plugin for users that won't upgrade to WordPress 6.3.How?
Renaming stuff.
Testing Instructions
The unit tests should pass.