Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



strip_core_block_namespace ›

Seit5.3.1
Veraltetn/v
strip_core_block_namespace ( $block_name = null )
Parameter:
  • (string) $block_name Original block name.
    Erforderlich: Nein
    Standard: null
Gibt zurück:
  • (string) Block name to use for serialization.
Definiert in:
Codex:

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



Quellcode

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

	return $block_name;
}