get_parent_theme_file_uri

The timeline below displays how wordpress function get_parent_theme_file_uri has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.7

/**
 * Retrieves the URL of a file in the parent theme.
 *
 * @since 4.7.0
 *
 * @param string $file Optional. File to return the URL for in the template directory.
 * @return string The URL of the file.
 */
function get_parent_theme_file_uri($file = '')
{
    $file = ltrim($file, '/');
    if (empty($file)) {
        $url = get_template_directory_uri();
    } else {
        $url = get_template_directory_uri() . '/' . $file;
    }
    /**
     * Filters the URL to a file in the parent theme.
     *
     * @since 4.7.0
     *
     * @param string $url  The file URL.
     * @param string $file The requested file to search for.
     */
    return apply_filters('parent_theme_file_uri', $url, $file);
}