Skip to content

Instantly share code, notes, and snippets.

@nb
Last active December 16, 2016 18:39
Show Gist options
  • Save nb/0875c6b7343418627d02 to your computer and use it in GitHub Desktop.
Save nb/0875c6b7343418627d02 to your computer and use it in GitHub Desktop.
<?php
/**
* Retrieve category, tag, or term description.
*
* @since 4.1.0
*
* @return string Archive description.
*/
function get_the_archive_description() {
$description = '';
if ( is_post_type_archive() ) {
$description = post_type_archive_description( '', false );
} else {
$description = term_description();
}
/**
* Filter the archive description.
*
* @since 4.1.0
*
* @see term_description()
* @see post_type_archive_description();
*
* @param string $description Archive description to be displayed.
*/
return apply_filters( 'get_the_archive_description', $description );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment