Opened 2 years ago
Closed 8 months ago
#17837 closed defect (bug) (fixed)
Calendar widget title markup displayed when empty
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | General | Version: | 3.1.3 |
| Severity: | trivial | Keywords: | has-patch dev-feedback commit |
| Cc: | michael@… |
Description
For Calendar widgets, the widget title markup is output even if the title field is left empty. For instance, <h2 class="widgettitle"> <h2>
Conversely, when a Text widget title field is left empty, no markup is output.
Attachments (1)
Change History (7)
jakub.tyrcha — 23 months ago
comment:1
jakub.tyrcha — 23 months ago
- Cc michael@… added
- Keywords dev-feedback added
I think that this is a great idea! In a few themes, I have had to filter the widget title like:
function mytheme_calendar_widget_title( $title = '', $instance = '', $id_base = '' ) {
if ( 'calendar' == $id_base && ' ' == $title )
$title = '';
return $title;
}
I find that it is always necessary to do when the widget title has a background color applied. In the event that the user leaves the title blank, a weird square will appear above the calendar.
comment:4
MikeHansenMe — 8 months ago
Patch works perfect. It not only is noticeable when the title has a background color but creates an awkward whitespace when it is empty due to the line-height 18px being applied to the

here you go