Changeset 25310
- Timestamp:
- 09/10/2013 02:27:24 AM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r25119 r25310 466 466 if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) { 467 467 $current_term_object = get_queried_object(); 468 if ( $ r['taxonomy']== $current_term_object->taxonomy )468 if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy ) 469 469 $r['current_category'] = get_queried_object_id(); 470 470 } … … 1038 1038 */ 1039 1039 function term_description( $term = 0, $taxonomy = 'post_tag' ) { 1040 if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {1040 if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) { 1041 1041 $term = get_queried_object(); 1042 $taxonomy = $term->taxonomy; 1043 $term = $term->term_id; 1042 if ( $term ) { 1043 $taxonomy = $term->taxonomy; 1044 $term = $term->term_id; 1045 } 1044 1046 } 1045 1047 $description = get_term_field( 'description', $term, $taxonomy ); -
trunk/src/wp-includes/general-template.php
r25291 r25310 593 593 if ( is_tax() ) { 594 594 $term = get_queried_object(); 595 $tax = get_taxonomy( $term->taxonomy ); 596 $title = single_term_title( $tax->labels->name . $t_sep, false ); 595 if ( $term ) { 596 $tax = get_taxonomy( $term->taxonomy ); 597 $title = single_term_title( $tax->labels->name . $t_sep, false ); 598 } 597 599 } 598 600 … … 600 602 if ( is_author() ) { 601 603 $author = get_queried_object(); 602 $title = $author->display_name; 604 if ( $author ) 605 $title = $author->display_name; 603 606 } 604 607 … … 1693 1696 $term = get_queried_object(); 1694 1697 1695 $title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ); 1696 $href = get_category_feed_link( $term->term_id ); 1698 if ( $term ) { 1699 $title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ); 1700 $href = get_category_feed_link( $term->term_id ); 1701 } 1697 1702 } elseif ( is_tag() ) { 1698 1703 $term = get_queried_object(); 1699 1704 1700 $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ); 1701 $href = get_tag_feed_link( $term->term_id ); 1705 if ( $term ) { 1706 $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ); 1707 $href = get_tag_feed_link( $term->term_id ); 1708 } 1702 1709 } elseif ( is_author() ) { 1703 1710 $author_id = intval( get_query_var('author') ); … … 1710 1717 } elseif ( is_post_type_archive() ) { 1711 1718 $title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) ); 1712 $href = get_post_type_archive_feed_link( get_queried_object()->name ); 1719 $post_type_obj = get_queried_object(); 1720 if ( $post_type_obj ) 1721 $href = get_post_type_archive_feed_link( $post_type_obj->name ); 1713 1722 } 1714 1723 -
trunk/src/wp-includes/link-template.php
r25085 r25310 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 -
trunk/src/wp-includes/template.php
r25291 r25310 257 257 // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object 258 258 $post = get_queried_object(); 259 $pagename = $post->post_name; 259 if ( $post ) 260 $pagename = $post->post_name; 260 261 } 261 262
Note: See TracChangeset
for help on using the changeset viewer.