wc_untokenize_path()WC 4.3.0

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

Хуков нет.

Возвращает

Строку. The absolute path.

Использование

wc_untokenize_path( $path, $path_tokens );
$path(строка) (обязательный)
The absolute path to expand.
$path_tokens(массив) (обязательный)
An array keyed with the token, containing paths that should be expanded.

Список изменений

С версии 4.3.0 Введена.

Код wc_untokenize_path() 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;
}