Last active
December 16, 2016 18:39
-
-
Save nb/0875c6b7343418627d02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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