[ Index ]

PHP Cross Reference of WordPress

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   *
  21   * @return boolean Whether to serialize block support styles & classes.
  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  }


Generated: Tue Jun 28 01:00:03 2022 Cross-referenced by PHPXref 0.7.1