-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Check for WP5.5 and skip registering routes #23880
Conversation
Size Change: 0 B Total Size: 1.14 MB ℹ️ View Unchanged
|
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! I haven't tested but left a bit of feedback.
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 tested this by echoing some output in the endpoint response from Gutenberg. It handles the response with WordPress 5.4. When I upgraded to WordPress 5.5 beta, the core endpoint handled the response.
Seems to work as expected. Thanks!
Description
The Image Editor routes are included in WP 5.5, so do not need to be registered in the plugin. This change adds a check and only registers if the version is less than 5.5
How has this been tested?
Use WordPress 5.4.x and the Gutenberg plugin and confirm the routes load as expected.
Use WordPress 5.5-beta+ and the Gutenberg plugin and confirm the routes are loaded from core and not the plugin.
Types of changes
Adds a logic check for version around the route registration using PHP's version_compare function.
Checklist: