[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/block-supports/ -> utils.php (source)

   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   * @return bool Whether to serialize block support styles & classes.
  21   */
  22  function wp_should_skip_block_supports_serialization( $block_type, $feature_set, $feature = null ) {
  23      if ( ! is_object( $block_type ) || ! $feature_set ) {
  24          return false;
  25      }
  26  
  27      $path               = array( $feature_set, '__experimentalSkipSerialization' );
  28      $skip_serialization = _wp_array_get( $block_type->supports, $path, false );
  29  
  30      if ( is_array( $skip_serialization ) ) {
  31          return in_array( $feature, $skip_serialization, true );
  32      }
  33  
  34      return $skip_serialization;
  35  }


Generated : Tue Sep 1 08:20:25 2026 Cross-referenced by PHPXref