[wp-trac] [WordPress Trac] #24788: Notice being displayed in page title on taxonomy archive pages

WordPress Trac noreply at wordpress.org
Wed Jul 17 20:41:30 UTC 2013


#24788: Notice being displayed in page title on taxonomy archive pages
--------------------------+-----------------------------
 Reporter:  ZaneMatthew   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.5.2
 Severity:  normal        |   Keywords:  dev-feedback
--------------------------+-----------------------------
 I'm receiving a PHP notice on custom taxonomy archive pages (or when ever
 is_tax() is set to true). It appears that the line
 [http://core.trac.wordpress.org/browser/tags/3.5.2/wp-includes/general-
 template.php#L543 #543 in general-template.php] should have an additional
 check for the $term thats being used.

 Below is the code in question:
 {{{
 if ( is_tax() ) {
         $tax = get_taxonomy( $term->taxonomy );
         $title = single_term_title( $tax->labels->name . $t_sep, false );
 }
 }}}

 And this is my current local fix:
 {{{
 if ( is_tax() && $term = get_queried_object() && ! empty( $term ) ) {
     $tax = get_taxonomy( $term->taxonomy );
     $title = single_term_title( $tax->labels->name . $t_sep, false );
 }
 }}}

 thoughts?

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24788>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list