WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Theme_JSON_Resolver::get_file_path_from_theme() private WP 5.8.0

Builds the path to the given file and checks that it is readable.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

If it isn't, returns an empty string, otherwise returns the whole file path.

{} Это метод класса: WP_Theme_JSON_Resolver{}

Хуков нет.


Строку. The whole file path or empty if the file doesn't exist.


$result = WP_Theme_JSON_Resolver::get_file_path_from_theme( $file_name );
$file_name(строка) (обязательный)
Name of the file.

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

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

Код WP_Theme_JSON_Resolver::get_file_path_from_theme() WP 5.8.2

private static function get_file_path_from_theme( $file_name ) {
	 * This used to be a locate_template call. However, that method proved problematic
	 * due to its use of constants (STYLESHEETPATH) that threw errors in some scenarios.
	 * When the theme.json merge algorithm properly supports child themes,
	 * this should also fall back to the template path, as locate_template did.
	$located   = '';
	$candidate = get_stylesheet_directory() . '/' . $file_name;
	if ( is_readable( $candidate ) ) {
		$located = $candidate;
	return $located;