Filter hook 'theme_file_path'

in WP Core File wp-includes/link-template.php at line 4681

View Source

theme_file_path

Filter Hook
Description
Filters the path to a file in the theme.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 4681

Hook Parameters

Type Name Description
string $path The file path.
string $file The requested file to search for.

Usage Examples

Basic Usage
<?php
// Hook into theme_file_path
add_filter('theme_file_path', 'my_custom_filter', 10, 2);

function my_custom_filter($path, $file) {
    // Your custom filtering logic here
    return $path;
}

Source Code Context

wp-includes/link-template.php:4681 - How this hook is used in WordPress core
<?php
4676  	 * @since 4.7.0
4677  	 *
4678  	 * @param string $path The file path.
4679  	 * @param string $file The requested file to search for.
4680  	 */
4681  	return apply_filters( 'theme_file_path', $path, $file );
4682  }
4683  
4684  /**
4685   * Retrieves the path of a file in the parent theme.
4686   *

PHP Documentation

<?php
/**
	 * Filters the path to a file in the theme.
	 *
	 * @since 4.7.0
	 *
	 * @param string $path The file path.
	 * @param string $file The requested file to search for.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.