remove_block_asset_path_prefix( string $asset_handle_or_path )

Removes the block asset’s path prefix if provided.

Parameters Parameters


(string) (Required) Asset handle or prefixed path.

Top ↑

Return Return

(string) Path without the prefix or the original value.

Top ↑

Source Source

File: wp-includes/blocks.php

function remove_block_asset_path_prefix( $asset_handle_or_path ) {
	$path_prefix = 'file:';
	if ( 0 !== strpos( $asset_handle_or_path, $path_prefix ) ) {
		return $asset_handle_or_path;
	return substr(
		strlen( $path_prefix )

Top ↑

Changelog Changelog

Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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