strip_core_block_namespace( string $block_name = null )

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

Parameters Parameters


(string) (Optional) Original block name.

Default value: null

Top ↑

Return Return

(string) Block name to use for serialization.

Top ↑

Source Source

File: wp-includes/blocks.php

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;

Top ↑

Changelog Changelog

Version Description
5.3.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.