Opened 15 years ago
Closed 13 years ago
#16632 closed defect (bug) (fixed)
Template title tags shouldn't ignore the prefix,even if 'display' is false
| Reported by: | yoavf | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Template | Version: | 3.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Some template title tags that accept both the $prefix and $display paramater ignore the prefix if the display is set to false, i.e. single_post_title(), single_term_title().
Some don't, i.e. single_month_title().
It doesn't make sense to ignore the prefix - if the developer doesn't want it, he can leave it empty.
Attachments (2)
Change History (8)
#2
@
13 years ago
- Cc added
- Keywords needs-refresh added
This is still an issue in WordPress V3.5.2.
In wp-includes/general-template.php at line 635 there is an if statement testing the $display argument. If $display is true, $prefix and $title are echoed. If $display is false, only $title is echoed.
if ( $display ) echo $prefix . $title; else return $title; // Should be return $prefix . $title;
Additional instances of this logic error that I have come across:
- post_type_archive_title() in wp-includes/general-template.php at line 660
- single_term_title() in wp-includes/general-template.php at line 743
- single_cat_title() because it calls single_term_title()
- single_tag_title() because it calls single_term_title()
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Yes, I have detected the same bug. The prefix must be also included if display is set to false.