#24788 closed defect (bug) (duplicate)
Notice being displayed in page title on taxonomy archive pages
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.2 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
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)
Note: See
TracTickets for help on using
tickets.
Check it now, it does