diff --git wp-includes/category-template.php wp-includes/category-template.php
index 96a61cf..b82fcfd 100644
|
|
|
function wp_list_categories( $args = '' ) { |
| 467 | 467 | |
| 468 | 468 | if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) { |
| 469 | 469 | $current_term_object = get_queried_object(); |
| 470 | | if ( $r['taxonomy'] == $current_term_object->taxonomy ) |
| | 470 | if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy ) |
| 471 | 471 | $r['current_category'] = get_queried_object_id(); |
| 472 | 472 | } |
| 473 | 473 | |
| … |
… |
function tag_description( $tag = 0 ) { |
| 1039 | 1039 | * @return string Term description, available. |
| 1040 | 1040 | */ |
| 1041 | 1041 | function term_description( $term = 0, $taxonomy = 'post_tag' ) { |
| 1042 | | if ( !$term && ( is_tax() || is_tag() || is_category() ) ) { |
| | 1042 | if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) { |
| 1043 | 1043 | $term = get_queried_object(); |
| 1044 | | $taxonomy = $term->taxonomy; |
| 1045 | | $term = $term->term_id; |
| | 1044 | if ( $term ) { |
| | 1045 | $taxonomy = $term->taxonomy; |
| | 1046 | $term = $term->term_id; |
| | 1047 | } |
| 1046 | 1048 | } |
| 1047 | 1049 | $description = get_term_field( 'description', $term, $taxonomy ); |
| 1048 | 1050 | return is_wp_error( $description ) ? '' : $description; |
diff --git wp-includes/general-template.php wp-includes/general-template.php
index b586762..4ad561c 100644
|
|
|
function wp_title($sep = '»', $display = true, $seplocation = '') { |
| 585 | 585 | // If there's a taxonomy |
| 586 | 586 | if ( is_tax() ) { |
| 587 | 587 | $term = get_queried_object(); |
| 588 | | $tax = get_taxonomy( $term->taxonomy ); |
| 589 | | $title = single_term_title( $tax->labels->name . $t_sep, false ); |
| | 588 | if ( $term ) { |
| | 589 | $tax = get_taxonomy( $term->taxonomy ); |
| | 590 | $title = single_term_title( $tax->labels->name . $t_sep, false ); |
| | 591 | } |
| 590 | 592 | } |
| 591 | 593 | |
| 592 | 594 | // If there's an author |
| 593 | 595 | if ( is_author() ) { |
| 594 | 596 | $author = get_queried_object(); |
| 595 | | $title = $author->display_name; |
| | 597 | if ( $author ) |
| | 598 | $title = $author->display_name; |
| 596 | 599 | } |
| 597 | 600 | |
| 598 | 601 | // If there's a post type archive |
| … |
… |
function post_type_archive_title( $prefix = '', $display = true ) { |
| 696 | 699 | if ( ! is_post_type_archive() ) |
| 697 | 700 | return; |
| 698 | 701 | |
| | 702 | $_title = ''; |
| | 703 | |
| 699 | 704 | $post_type_obj = get_queried_object(); |
| 700 | | $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name ); |
| | 705 | if ( $post_type_obj ) |
| | 706 | $_title = $post_type_obj->labels->name; |
| | 707 | |
| | 708 | $title = apply_filters( 'post_type_archive_title', $_title ); |
| 701 | 709 | |
| 702 | 710 | if ( $display ) |
| 703 | 711 | echo $prefix . $title; |
| … |
… |
function feed_links_extra( $args = array() ) { |
| 1681 | 1689 | } elseif ( is_category() ) { |
| 1682 | 1690 | $term = get_queried_object(); |
| 1683 | 1691 | |
| 1684 | | $title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ); |
| 1685 | | $href = get_category_feed_link( $term->term_id ); |
| | 1692 | if ( $term ) { |
| | 1693 | $title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ); |
| | 1694 | $href = get_category_feed_link( $term->term_id ); |
| | 1695 | } |
| 1686 | 1696 | } elseif ( is_tag() ) { |
| 1687 | 1697 | $term = get_queried_object(); |
| 1688 | 1698 | |
| 1689 | | $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ); |
| 1690 | | $href = get_tag_feed_link( $term->term_id ); |
| | 1699 | if ( $term ) { |
| | 1700 | $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ); |
| | 1701 | $href = get_tag_feed_link( $term->term_id ); |
| | 1702 | } |
| 1691 | 1703 | } elseif ( is_author() ) { |
| 1692 | 1704 | $author_id = intval( get_query_var('author') ); |
| 1693 | 1705 | |
| … |
… |
function feed_links_extra( $args = array() ) { |
| 1698 | 1710 | $href = get_search_feed_link(); |
| 1699 | 1711 | } elseif ( is_post_type_archive() ) { |
| 1700 | 1712 | $title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) ); |
| 1701 | | $href = get_post_type_archive_feed_link( get_queried_object()->name ); |
| | 1713 | $post_type_obj = get_queried_object(); |
| | 1714 | if ( $post_type_obj ) |
| | 1715 | $href = get_post_type_archive_feed_link( $post_type_obj->name ); |
| 1702 | 1716 | } |
| 1703 | 1717 | |
| 1704 | 1718 | if ( isset($title) && isset($href) ) |
diff --git wp-includes/link-template.php wp-includes/link-template.php
index 5fb6172..3770a23 100644
|
|
|
function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) { |
| 713 | 713 | * @return string HTML content. |
| 714 | 714 | */ |
| 715 | 715 | function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) { |
| 716 | | if ( is_null( $term ) ) { |
| | 716 | if ( is_null( $term ) ) |
| 717 | 717 | $term = get_queried_object(); |
| 718 | | } |
| | 718 | |
| | 719 | if ( ! $term ) |
| | 720 | return; |
| 719 | 721 | |
| 720 | 722 | $tax = get_taxonomy( $term->taxonomy ); |
| 721 | | if ( !current_user_can($tax->cap->edit_terms) ) |
| | 723 | if ( ! current_user_can( $tax->cap->edit_terms ) ) |
| 722 | 724 | return; |
| 723 | 725 | |
| 724 | 726 | if ( empty( $link ) ) |
diff --git wp-includes/template.php wp-includes/template.php
index 5bee8ad..26bdb41 100644
|
|
|
function get_page_template() { |
| 241 | 241 | if ( ! $pagename && $id ) { |
| 242 | 242 | // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object |
| 243 | 243 | $post = get_queried_object(); |
| 244 | | $pagename = $post->post_name; |
| | 244 | if ( $post ) |
| | 245 | $pagename = $post->post_name; |
| 245 | 246 | } |
| 246 | 247 | |
| 247 | 248 | $templates = array(); |