Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#24788 closed defect (bug) (duplicate)

Notice being displayed in page title on taxonomy archive pages

Reported by: ZaneMatthew Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.2
Component: Taxonomy Keywords:
Focuses: Cc:


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 #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 );


Change History (3)

#1 @iseulde
8 years ago

  • Component changed from General to Taxonomy

#2 @wonderboymusic
8 years ago

  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Check it now, it does

#3 @SergeyBiryukov
8 years ago

  • Resolution changed from invalid to duplicate

Duplicate of #21394.

Note: See TracTickets for help on using tickets.