#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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Check it now, it does