Skip to content
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

Require relocated class files for back-compat in WordPress releases. #51670

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

peterwilsoncc
Copy link
Contributor

What?

This PR adds require_once calls for relocated classes in packages/block-serialization-default-parser/class-wp-block-parser.php.

This is required to maintain backward compatibly once the package is updated in WordPress-Develop and subsequently included in a WordPress Core release.

Why?

In #48693 the block parser classes were split in to their own files per the WordPress Coding Standards.

In the package the three class files were renamed and back-compatibility maintained by retaining parser.php for developers requiring the files directory.

However, once the package is updated in WordPress-Develop, the copied file will be packages/block-serialization-default-parser/class-wp-block-parser.php to replace the file of the same name in WP-Dev's wp-includes folder, packages/block-serialization-default-parser/parser.php won't be included in a WordPress release.

To maintain backward compatibility for developers requiring the file directly in WordPress-Develop/releases, the relocated classes need to be required from their original location.

See src/wp-includes/class-wp-customize-control.php in WordPress-Develop for an example of how back-compat has been historically maintained.

How?

Requires classes within files as needed.

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@peterwilsoncc peterwilsoncc requested a review from dmsnell as a code owner June 20, 2023 03:14
@peterwilsoncc peterwilsoncc added the Backwards Compatibility Issues or PRs that impact backwards compatability label Jun 20, 2023
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aristath aristath merged commit 5693a62 into trunk Jun 20, 2023
@aristath aristath deleted the fix/wp57832-backcompat-follow-up branch June 20, 2023 08:33
@github-actions github-actions bot added this to the Gutenberg 16.1 milestone Jun 20, 2023
sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants