Require relocated class files for back-compat in WordPress releases. #51670
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.
What?
This PR adds
require_once
calls for relocated classes inpackages/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'swp-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