Template: In get_the_archive_description()
, add support for author archives.
Props henry.wright. Fixes #37259. git-svn-id: https://develop.svn.wordpress.org/trunk@38486 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b08ba54e61
commit
ca40b18e81
@ -1505,7 +1505,7 @@ function get_the_archive_title() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Display category, tag, or term description.
|
||||
* Display category, tag, term, or author description.
|
||||
*
|
||||
* @since 4.1.0
|
||||
*
|
||||
@ -1522,13 +1522,20 @@ function the_archive_description( $before = '', $after = '' ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve category, tag, or term description.
|
||||
* Retrieve category, tag, term, or author description.
|
||||
*
|
||||
* @since 4.1.0
|
||||
* @since 4.7.0 Added support for author archives.
|
||||
*
|
||||
* @return string Archive description.
|
||||
*/
|
||||
function get_the_archive_description() {
|
||||
if ( is_author() ) {
|
||||
$description = get_the_author_meta( 'description' );
|
||||
} else {
|
||||
$description = term_description();
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the archive description.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user