author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
permissions | -rw-r--r-- |
19 | 1 |
<?php |
2 |
/** |
|
3 |
* Block support utility functions. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Block Supports |
|
7 |
* @since 6.0.0 |
|
8 |
*/ |
|
9 |
||
10 |
/** |
|
11 |
* Checks whether serialization of the current block's supported properties |
|
12 |
* should occur. |
|
13 |
* |
|
14 |
* @since 6.0.0 |
|
15 |
* @access private |
|
16 |
* |
|
17 |
* @param WP_Block_Type $block_type Block type. |
|
18 |
* @param string $feature_set Name of block support feature set.. |
|
19 |
* @param string $feature Optional name of individual feature to check. |
|
20 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
21 |
* @return bool Whether to serialize block support styles & classes. |
19 | 22 |
*/ |
23 |
function wp_should_skip_block_supports_serialization( $block_type, $feature_set, $feature = null ) { |
|
24 |
if ( ! is_object( $block_type ) || ! $feature_set ) { |
|
25 |
return false; |
|
26 |
} |
|
27 |
||
28 |
$path = array( $feature_set, '__experimentalSkipSerialization' ); |
|
29 |
$skip_serialization = _wp_array_get( $block_type->supports, $path, false ); |
|
30 |
||
31 |
if ( is_array( $skip_serialization ) ) { |
|
32 |
return in_array( $feature, $skip_serialization, true ); |
|
33 |
} |
|
34 |
||
35 |
return $skip_serialization; |
|
36 |
} |