Automattic\WooCommerce\Blocks
BlockTypesController::bypass_block_metadata_doing_it_wrong()
Temporarily bypasses _doing_it_wrong() notices for block metadata collection registration.
WordPress 6.7 introduced block metadata collections (with strict path validation). Any sites using symlinks for plugins will fail the validation which causes the metadata collection to not be registered. However, the blocks will still fall back to the regular registration and no functionality is affected. While this validation is being discussed in WordPress Core (#62140), this method allows registration to proceed by temporarily disabling the relevant notice.
Метод класса: BlockTypesController{}
Хуков нет.
Возвращает
true|false
. Whether to trigger the error.
Использование
$result = BlockTypesController::bypass_block_metadata_doing_it_wrong( $trigger, $function, $message, $version );
- $trigger(true|false) (обязательный)
- Whether to trigger the error.
- $function(строка) (обязательный)
- The function that was called.
- $message(строка) (обязательный)
- A message explaining what was done incorrectly.
- $version(строка) (обязательный)
- The version of WordPress where the message was added.
Код BlockTypesController::bypass_block_metadata_doing_it_wrong() BlockTypesController::bypass block metadata doing it wrong WC 9.7.1
public static function bypass_block_metadata_doing_it_wrong( $trigger, $function, $message, $version ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable,Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed,Universal.NamingConventions.NoReservedKeywordParameterNames.functionFound if ( 'WP_Block_Metadata_Registry::register_collection' === $function ) { return false; } return $trigger; }