-
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
Allow child classes to use the private methods and constants #38625
Conversation
I guess this needs to be backported to 5.9.1 ideally right? |
Yeah, that's my thinking. Otherwise, we need to copy a lot of things to the |
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.
This looks good to me but It's very hard to know if it's enough or if we're missing anything.
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 noticed that there are still a number of private functions and properties, should we change everything to "protected" or are changing only what we need to extend now?
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 @oandregal! LGTM!
@@ -426,7 +426,7 @@ private static function sanitize( $input, $valid_block_names, $valid_element_nam | |||
return $output; | |||
} | |||
|
|||
$output = array_intersect_key( $input, array_flip( self::VALID_TOP_LEVEL_KEYS ) ); | |||
$output = array_intersect_key( $input, array_flip( static::VALID_TOP_LEVEL_KEYS ) ); |
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.
Thank you for making these changes for the patterns PR ❤️
I think we can be conservative and change what we need for now, unless there is no specific reason at all to keep them as private. |
I'd love if we do that in order to update the patterns PR tomorrow and verify that these are the only needed changes. |
Yeah, these are the only changes needed for that PR. I have already the modifications to the patterns PR locally for testing. I can push them if that's ok. |
Follow up with the rest of the changes at #38671 |
…and VALID_TOP_LEVEL_KEYS (#38625)
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Fixes #55178. See #55179. git-svn-id: https://develop.svn.wordpress.org/trunk@52744 602fd350-edb4-49c9-b593-d223f7449a82
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/trunk@52744 git-svn-id: http://core.svn.wordpress.org/trunk@52333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/trunk@52744 git-svn-id: https://core.svn.wordpress.org/trunk@52333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Merges [52744] to the 5.9 branch. Fixes #55178. See #55179. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@52746 602fd350-edb4-49c9-b593-d223f7449a82
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Merges [52744] to the 5.9 branch. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/branches/5.9@52746 git-svn-id: http://core.svn.wordpress.org/branches/5.9@52335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Merges [52744] to the 5.9 branch. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/branches/5.9@52746 git-svn-id: https://core.svn.wordpress.org/branches/5.9@52335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Merges [52744] to the 5.9 branch. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/branches/5.9@52746
…classes. This change updates methods visibility from `private` to `protected` and adds late static binding. Original PRs from Gutenberg repository: - WordPress/gutenberg#38625 - WordPress/gutenberg#38671 Props oandregal, Mamaduka, kapilpaul. Merges [52744] to the 5.9 branch. Fixes #55178. See #55179. Built from https://develop.svn.wordpress.org/branches/5.9@52746 git-svn-id: http://core.svn.wordpress.org/branches/5.9@52335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This PR allows #37140 to override the
WP_Theme_JSON_Resolver_Gutenberg
class and theVALID_TOP_LEVEL_SETTINGS
for this #38323