wpseek.com
WordPress开发者和主题制作者的搜索引擎



strip_core_block_namespace › WordPress Function

Since5.3.1
已弃用n/a
strip_core_block_namespace ( $block_name = null )
参数:
  • (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.
    Required: No
    默认: null
返回:
  • (string) Block name to use for serialization.
定义在:
文档:

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



源码

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;
}