mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Block supports: migrate spacing, border, color, dimensions, elements and typography and associated tests. #2500
Closed
ramonjd
wants to merge
4
commits into
WordPress:trunk
from
ramonjd:migrate/wordpress-6.0-block-supports-spacing
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6ea51d5
Migrating block support spacing and associated tests from Gutenberg 1…
ramonjd 9a30959
Include utils for glory!
ramonjd 17b5929
Migrating border, color, dimensions, elements and typography and asso…
ramonjd 7fdd789
Merge branch 'WordPress:trunk' into migrate/wordpress-6.0-block-suppo…
ramonjd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Block support utility functions. | ||
* | ||
* @package WordPress | ||
* @since 6.0 | ||
*/ | ||
|
||
/** | ||
* Checks whether serialization of the current block's supported properties | ||
* should occur. | ||
* | ||
* @since 6.0 | ||
* @access private | ||
* | ||
* @param WP_Block_Type $block_type Block type. | ||
* @param string $feature_set Name of block support feature set.. | ||
* @param string $feature Optional name of individual feature to check. | ||
* | ||
* @return boolean Whether to serialize block support styles & classes. | ||
*/ | ||
function wp_should_skip_block_supports_serialization( $block_type, $feature_set, $feature = null ) { | ||
if ( ! is_object( $block_type ) || ! $feature_set ) { | ||
return false; | ||
} | ||
|
||
$path = array( $feature_set, '__experimentalSkipSerialization' ); | ||
$skip_serialization = _wp_array_get( $block_type->supports, $path, false ); | ||
|
||
if ( is_array( $skip_serialization ) ) { | ||
return in_array( $feature, $skip_serialization, true ); | ||
} | ||
|
||
return $skip_serialization; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
@peterwilsoncc or @hellofromtonya, should we keep functions like this one with no code and depreciation notice for backward compatibility or is it fine to remove as they were marked as private?
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.
The practice is to move the functions to deprecated and throw a warning, for example:
wordpress-develop/src/wp-includes/deprecated.php
Lines 3373 to 3386 in 6c270d0
Unfortunately plugin authors have a habit of ignoring private access statements. To be fair, some of this is self inflicted by things such as
WP_List_Table
still being marked as private.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 folks! If we decide it's a good idea to reinstate them, I've thrown up a PR here: #2522