wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



strip_core_block_namespace › WordPress Function

Depuis5.3.1
Dépréciéen/a
strip_core_block_namespace ( $block_name = null )
Paramètres:
  • (string|null) $block_name Optional. Original block name. Null if the block name is unknown, e.g. Classic blocks have their name set to null. Default null.
    Requis: Non
    Défaut: null
Retourne:
  • (string) Block name to use for serialization.
Défini(e) dans:
Codex:

Returns the block name to use for serialization. This will remove the default "core/" namespace from a block name.



Source

function strip_core_block_namespace( $block_name = null ) {
	if ( is_string( $block_name ) && str_starts_with( $block_name, 'core/' ) ) {
		return substr( $block_name, 5 );
	}

	return $block_name;
}