WordPress at a glance
function is not described

remove_block_asset_path_prefix() WP 5.5.0

Removes the block asset's path prefix if provided.

No Hooks.

Return

String. Path without the prefix or the original value.

Usage

remove_block_asset_path_prefix( $asset_handle_or_path );
$asset_handle_or_path(string) (required)
Asset handle or prefixed path.

Changelog

Since 5.5.0 Introduced.

Code of remove_block_asset_path_prefix() WP 5.7.2

<?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(
		$asset_handle_or_path,
		strlen( $path_prefix )
	);
}