get_template

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

WordPress Version: 6.1

/**
 * Retrieves name of the active theme.
 *
 * @since 1.5.0
 *
 * @return string Template name.
 */
function get_template()
{
    /**
     * Filters the name of the active theme.
     *
     * @since 1.5.0
     *
     * @param string $template active theme's directory name.
     */
    return apply_filters('template', get_option('template'));
}

WordPress Version: 5.5

/**
 * Retrieves name of the current theme.
 *
 * @since 1.5.0
 *
 * @return string Template name.
 */
function get_template()
{
    /**
     * Filters the name of the current theme.
     *
     * @since 1.5.0
     *
     * @param string $template Current theme's directory name.
     */
    return apply_filters('template', get_option('template'));
}

WordPress Version: 4.6

/**
 * Retrieve name of the current theme.
 *
 * @since 1.5.0
 *
 * @return string Template name.
 */
function get_template()
{
    /**
     * Filters the name of the current theme.
     *
     * @since 1.5.0
     *
     * @param string $template Current theme's directory name.
     */
    return apply_filters('template', get_option('template'));
}

WordPress Version: 4.1

/**
 * Retrieve name of the current theme.
 *
 * @since 1.5.0
 *
 * @return string Template name.
 */
function get_template()
{
    /**
     * Filter the name of the current theme.
     *
     * @since 1.5.0
     *
     * @param string $template Current theme's directory name.
     */
    return apply_filters('template', get_option('template'));
}

WordPress Version: 3.8

/**
 * Retrieve name of the current theme.
 *
 * @since 1.5.0
 * @uses apply_filters() Calls 'template' filter on template option.
 *
 * @return string Template name.
 */
function get_template()
{
    /**
     * Filter the name of the current theme.
     *
     * @since 1.5.0
     *
     * @param string $template Current theme's directory name.
     */
    return apply_filters('template', get_option('template'));
}

WordPress Version: 3.7

/**
 * Retrieve name of the current theme.
 *
 * @since 1.5.0
 * @uses apply_filters() Calls 'template' filter on template option.
 *
 * @return string Template name.
 */
function get_template()
{
    return apply_filters('template', get_option('template'));
}