Opened 15 years ago
Closed 15 years ago
#9450 closed defect (bug) (fixed)
Widgets should allow to have no titles + widget_title not always applied
Reported by: | Denis-de-Bernardy | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Widgets | Keywords: | has-patch tested commit |
Focuses: | Cc: |
Description
On occasion, it's desirable to have a widget with no title. In particular for the calendar.
Further, the widget_title filter isn't applied to the default value in the current WP 2.8 trunk setup.
The attached patch:
- Allows multi-widgets to have an empty title, for easier skinning
- Moves the default titles to the widget forms
Attachments (2)
Change History (17)
#2
@
15 years ago
Mm... can you confirm this when you tried it? It didn't occur when I tested it.
D.
#3
@
15 years ago
Apply patch, reload front page, titles disappear. You have to go to the widgets admin and save first.
#4
@
15 years ago
Ah, you mean on a verbatim install, or something like that? I think I get it.
How would you prefer that to be fixed? By adding a procedure of sorts in the upgrade scripts that actually sets the title for each widget that is missing one?
PS: the most important one, imo, is that of the calendar widget. The nbsp is a mess to skin. :-)
#5
follow-up:
↓ 8
@
15 years ago
added patch to fix calendar only. I'll make a separate one for the other widgets.
#8
in reply to:
↑ 5
@
15 years ago
Replying to Denis-de-Bernardy:
added patch to fix calendar only. I'll make a separate one for the other widgets.
Same as #9451, replacing the id with class would break existing themes that have styling for the calendar, the nbsp can probably be removed after testing in 20-30 of the most used themes.
#10
@
15 years ago
Don't know if we can upgrade this reliably. Add a "Hide Title" checkbox to work around our back-compat mess?
#11
@
15 years ago
Hehe... sounds like I'm going to keep my calendar widget fix plugin. :-D
I can certainly give the patch another run. How about the following:
- Calendar option gets upgraded by WP 2.8, so as to set the title to nbsp when empty.
- The same for other widget options
- The original patch is applied
#12
@
15 years ago
I think some of the multi-lang plugins depend on the text switching to match the current locale when the title is not set. Actually giving it a hard default in the DB will break this.
#13
@
15 years ago
Good point. So how about this patch instead:
- apply_filter always, even on empty title
- leave options as is, except for calendar, whose option gets upgraded on existing installs to its current setting (as modified by WP before the upgrade), and defaults to nbsp from now on.
- calendar doesn't show an empty title
#14
@
15 years ago
- Keywords commit added; dev-feedback removed
update patch proceeds as follows:
- applies the widget_title filter, always (allows themes to override the calendar's default in particular)
- if no title is around, do not output the h2 tags related to the title
this allows to easily override the default WP behavior without breaking backward compat.
Existing widgets will lose their titles until next time they are saved.