|
@@ 4067-4085 (lines=19) @@
|
| 4064 |
|
* @param string $file Optional. File to return the URL for in the template directory. |
| 4065 |
|
* @return string The URL of the file. |
| 4066 |
|
*/ |
| 4067 |
|
function get_parent_theme_file_uri( $file = '' ) { |
| 4068 |
|
$file = ltrim( $file, '/' ); |
| 4069 |
|
|
| 4070 |
|
if ( empty( $file ) ) { |
| 4071 |
|
$url = get_template_directory_uri(); |
| 4072 |
|
} else { |
| 4073 |
|
$url = get_template_directory_uri() . '/' . $file; |
| 4074 |
|
} |
| 4075 |
|
|
| 4076 |
|
/** |
| 4077 |
|
* Filters the URL to a file in the parent theme. |
| 4078 |
|
* |
| 4079 |
|
* @since 4.7.0 |
| 4080 |
|
* |
| 4081 |
|
* @param string $url The file URL. |
| 4082 |
|
* @param string $file The requested file to search for. |
| 4083 |
|
*/ |
| 4084 |
|
return apply_filters( 'parent_theme_file_uri', $url, $file ); |
| 4085 |
|
} |
| 4086 |
|
|
| 4087 |
|
/** |
| 4088 |
|
* Retrieves the path of a file in the theme. |
|
@@ 4128-4146 (lines=19) @@
|
| 4125 |
|
* @param string $file Optional. File to return the path for in the template directory. |
| 4126 |
|
* @return string The path of the file. |
| 4127 |
|
*/ |
| 4128 |
|
function get_parent_theme_file_path( $file = '' ) { |
| 4129 |
|
$file = ltrim( $file, '/' ); |
| 4130 |
|
|
| 4131 |
|
if ( empty( $file ) ) { |
| 4132 |
|
$path = get_template_directory(); |
| 4133 |
|
} else { |
| 4134 |
|
$path = get_template_directory() . '/' . $file; |
| 4135 |
|
} |
| 4136 |
|
|
| 4137 |
|
/** |
| 4138 |
|
* Filters the path to a file in the parent theme. |
| 4139 |
|
* |
| 4140 |
|
* @since 4.7.0 |
| 4141 |
|
* |
| 4142 |
|
* @param string $path The file path. |
| 4143 |
|
* @param string $file The requested file to search for. |
| 4144 |
|
*/ |
| 4145 |
|
return apply_filters( 'parent_theme_file_path', $path, $file ); |
| 4146 |
|
} |
| 4147 |
|
|