theme_file_path filter-hookWP 4.7.0

Filters the path to a file in the theme.

Usage

add_filter( 'theme_file_path', 'wp_kama_theme_file_path_filter', 10, 2 );

/**
 * Function for `theme_file_path` filter-hook.
 * 
 * @param string $path The file path.
 * @param string $file The requested file to search for.
 *
 * @return string
 */
function wp_kama_theme_file_path_filter( $path, $file ){

	// filter...
	return $path;
}
$path(string)
The file path.
$file(string)
The requested file to search for.

Changelog

Since 4.7.0 Introduced.

Where the hook is called

get_theme_file_path()
theme_file_path
WP_Theme::get_file_path()
theme_file_path
wp_theme_has_theme_json()
theme_file_path
wp-includes/link-template.php 4651
return apply_filters( 'theme_file_path', $path, $file );
wp-includes/class-wp-theme.php 1619
return apply_filters( 'theme_file_path', $path, $file );
wp-includes/global-styles-and-settings.php 433
$path = apply_filters( 'theme_file_path', $path, 'theme.json' );

Where the hook is used in WordPress

Usage not found.