wp_should_skip_block_supports_serialization

函数


wp_should_skip_block_supports_serialization ( $block_type, $feature_set, $feature = null )
Access
Private
参数
  • (WP_Block_Type)
    $block_type
    Block type.
    Required:
  • (string)
    $feature_set
    Name of block support feature set..
    Required:
  • (string)
    $feature
    Optional name of individual feature to check.
    Required:
    Default: null
返回值
  • (bool) Whether to serialize block support styles & classes.
定义位置
  • wp-includes/block-supports/utils.php
    , line 23
引入
6.0.0
弃用

Checks whether serialization of the current block’s supported properties
should occur.

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;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。