strip_core_block_namespace()
Returns the block name to use for serialization. This will remove the default "core/" namespace from a block name.
Хуков нет.
Возвращает
string. Block name to use for serialization.
Использование
strip_core_block_namespace( $block_name );
- $block_name(строка|null)
- Original block name. Null if the block name is unknown, e.g. Classic blocks have their name set to null.
По умолчанию:null
Список изменений
| С версии 5.3.1 | Введена. |
Код strip_core_block_namespace() strip core block namespace WP 7.1
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;
}