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

Allow child classes to use the private methods and constants #38625

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Feb 8, 2022

This PR allows #37140 to override the WP_Theme_JSON_Resolver_Gutenberg class and the VALID_TOP_LEVEL_SETTINGS for this #38323

@oandregal oandregal self-assigned this Feb 8, 2022
@oandregal oandregal requested a review from ntsekouras February 8, 2022 13:50
@oandregal oandregal mentioned this pull request Feb 8, 2022
7 tasks
@oandregal oandregal marked this pull request as ready for review February 8, 2022 13:51
@oandregal oandregal added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Feb 8, 2022
@youknowriad
Copy link
Contributor

I guess this needs to be backported to 5.9.1 ideally right?

@oandregal
Copy link
Member Author

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 compat/6.0 folder and do the same changes there.

Copy link
Contributor

@youknowriad youknowriad left a 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.

Copy link
Contributor

@youknowriad youknowriad left a 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?

Copy link
Contributor

@ntsekouras ntsekouras left a 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 ) );
Copy link
Contributor

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 ❤️

@youknowriad youknowriad added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Feb 8, 2022
@ntsekouras
Copy link
Contributor

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?

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.

@oandregal
Copy link
Member Author

This only addresses the changes needed for #38323 and #37140.

There's also #37770 and, in general, making sure this is child-friendly. I'm fine with merging as it is and preparing a second PR for these changes or holding off from merging until we have all that we need.

@ntsekouras
Copy link
Contributor

I'm fine with merging as it is and preparing a second PR for these changes

I'd love if we do that in order to update the patterns PR tomorrow and verify that these are the only needed changes.

@oandregal
Copy link
Member Author

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.

@oandregal oandregal merged commit 70730e6 into trunk Feb 9, 2022
@oandregal oandregal deleted the update/extend-theme-json branch February 9, 2022 09:41
@github-actions github-actions bot added this to the Gutenberg 12.6 milestone Feb 9, 2022
@oandregal
Copy link
Member Author

Follow up with the rest of the changes at #38671

@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Feb 16, 2022
Mamaduka pushed a commit that referenced this pull request Feb 16, 2022
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Feb 17, 2022
…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
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Feb 17, 2022
…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
github-actions bot pushed a commit to gilzow/wordpress-performance that referenced this pull request Feb 17, 2022
…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
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Feb 17, 2022
…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
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Feb 17, 2022
…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
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Feb 17, 2022
…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
whereiscodedude pushed a commit to whereiscodedude/wpss that referenced this pull request Sep 18, 2022
…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
VenusPR added a commit to VenusPR/Wordpress_Richard that referenced this pull request Mar 9, 2023
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants