Make WordPress Core

Changeset 38486


Ignore:
Timestamp:
08/31/2016 11:00:36 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Template: In get_the_archive_description(), add support for author archives.

Props henry.wright.
Fixes #37259.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r38477 r38486  
    15061506
    15071507/**
    1508  * Display category, tag, or term description.
     1508 * Display category, tag, term, or author description.
    15091509 *
    15101510 * @since 4.1.0
     
    15231523
    15241524/**
    1525  * Retrieve category, tag, or term description.
     1525 * Retrieve category, tag, term, or author description.
    15261526 *
    15271527 * @since 4.1.0
     1528 * @since 4.7.0 Added support for author archives.
    15281529 *
    15291530 * @return string Archive description.
    15301531 */
    15311532function get_the_archive_description() {
     1533    if ( is_author() ) {
     1534        $description = get_the_author_meta( 'description' );
     1535    } else {
     1536        $description = term_description();
     1537    }
     1538
    15321539    /**
    15331540     * Filters the archive description.
Note: See TracChangeset for help on using the changeset viewer.