PluginProbe
Gutenberg / 13.2.2
Gutenberg v13.2.2
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / block-supports / utils.php

utils.php in Gutenberg 13.2.2, at lib/block-supports/utils.php

32 lines 937 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Block support utility functions.
4 *
5 * @package gutenberg
6 */
7
8 /**
9 * Checks whether serialization of the current block's supported properties
10 * should occur.
11 *
12 * @param WP_Block_type $block_type Block type.
13 * @param string $feature_set Name of block support feature set..
14 * @param string $feature Optional name of individual feature to check.
15 *
16 * @return boolean Whether to serialize block support styles & classes.
17 */
18 function gutenberg_should_skip_block_supports_serialization( $block_type, $feature_set, $feature = null ) {
19 if ( ! is_object( $block_type ) || ! $feature_set ) {
20 return false;
21 }
22
23 $path = array( $feature_set, '__experimentalSkipSerialization' );
24 $skip_serialization = _wp_array_get( $block_type->supports, $path, false );
25
26 if ( is_array( $skip_serialization ) ) {
27 return in_array( $feature, $skip_serialization, true );
28 }
29
30 return $skip_serialization;
31 }
32