get_the_archive_description() WordPress Function

The get_the_archive_description() function returns the description for the current archive view. This is typically used on category and tag archive pages.

get_the_archive_description() #

Retrieves the description for an author, post type, or term archive.


Description

Top ↑

See also


Top ↑

Return

(string) Archive description.


Top ↑

Source

File: wp-includes/general-template.php

function get_the_archive_description() {
	if ( is_author() ) {
		$description = get_the_author_meta( 'description' );
	} elseif ( is_post_type_archive() ) {
		$description = get_the_post_type_description();
	} else {
		$description = term_description();
	}

	/**
	 * Filters the archive description.
	 *
	 * @since 4.1.0
	 *
	 * @param string $description Archive description to be displayed.
	 */
	return apply_filters( 'get_the_archive_description', $description );
}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Added support for post type archives.
4.7.0Added support for author archives.
4.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More