wc_untokenize_path()WC 4.3.0

Given a tokenized path, this will expand the tokens to their full path.

No Hooks.

Return

String. The absolute path.

Usage

wc_untokenize_path( $path, $path_tokens );
$path(string) (required)
The absolute path to expand.
$path_tokens(array) (required)
An array keyed with the token, containing paths that should be expanded.

Changelog

Since 4.3.0 Introduced.

wc_untokenize_path() code WC 8.7.0

function wc_untokenize_path( $path, $path_tokens ) {
	foreach ( $path_tokens as $token => $token_path ) {
		$path = str_replace( '{{' . $token . '}}', $token_path, $path );
	}

	return $path;
}