Changeset 40976 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 07/01/2017 05:14:18 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r40955 r40976 1541 1541 1542 1542 /** 1543 * Retrieve category, tag, term, or author description.1543 * Retrieves the description for an author, post type, or term archive. 1544 1544 * 1545 1545 * @since 4.1.0 1546 1546 * @since 4.7.0 Added support for author archives. 1547 * @since 4.9.0 Added support for post type archives. 1547 1548 * 1548 1549 * @see term_description() … … 1551 1552 */ 1552 1553 function get_the_archive_description() { 1554 $description = ''; 1555 1553 1556 if ( is_author() ) { 1554 1557 $description = get_the_author_meta( 'description' ); 1558 } elseif ( is_post_type_archive() ) { 1559 $post_type = get_query_var( 'post_type' ); 1560 1561 if ( is_array( $post_type ) ) { 1562 $post_type = reset( $post_type ); 1563 } 1564 1565 $post_type_obj = get_post_type_object( $post_type ); 1566 1567 // Check if a description is set. 1568 if ( isset( $post_type_obj->description ) ) { 1569 $description = $post_type_obj->description; 1570 } 1555 1571 } else { 1556 1572 $description = term_description();
Note: See TracChangeset
for help on using the changeset viewer.