WordPress at a glance

get_the_archive_description() WP 1.0

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

  • See: term_description()
  • Since 4.7.0 Added support for author archives.
  • Since 4.9.0 Added support for post type archives.
Is the basis for: the_archive_description()
Hooks from function:
Return

String. Archive description.

Usage

get_the_archive_description();

Code of get_the_archive_description: wp-includes/general-template.php VER 4.9.8

<?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 );
}

Related Functions

From tag: Description (of post term)

More from category: Archives

No comments
    Hello, !     Log In . Register