Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#24788 closed defect (bug) (duplicate)

Notice being displayed in page title on taxonomy archive pages

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

Description

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

thoughts?

Change History (3)

#1 @iseulde
13 years ago

  • Component GeneralTaxonomy

#2 @wonderboymusic
13 years ago

  • Keywords dev-feedback removed
  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Check it now, it does

#3 @SergeyBiryukov
13 years ago

  • Resolution invalidduplicate

Duplicate of #21394.

Note: See TracTickets for help on using tickets.