the_archive_title

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

WordPress Version: 6.1

/**
 * Displays the archive title based on the queried object.
 *
 * @since 4.1.0
 *
 * @see get_the_archive_title()
 *
 * @param string $before Optional. Content to prepend to the title. Default empty.
 * @param string $after  Optional. Content to append to the title. Default empty.
 */
function the_archive_title($before = '', $after = '')
{
    $title = get_the_archive_title();
    if (!empty($title)) {
        echo $before . $title . $after;
    }
}

WordPress Version: 4.1

/**
 * Display the archive title based on the queried object.
 *
 * @since 4.1.0
 *
 * @see get_the_archive_title()
 *
 * @param string $before Optional. Content to prepend to the title. Default empty.
 * @param string $after  Optional. Content to append to the title. Default empty.
 */
function the_archive_title($before = '', $after = '')
{
    $title = get_the_archive_title();
    if (!empty($title)) {
        echo $before . $title . $after;
    }
}