Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#10020 closed defect (bug) (fixed)

Extra hook needed over in the widgets

Reported by: Denis-de-Bernardy Owned by: azaozz
Milestone: 2.8 Priority: high
Severity: normal Version: 2.8
Component: Widgets Keywords: has-patch tested commit
Focuses: Cc:


See attached patch. It allows, among other things, to change the widget form's width when adding extra fields.

Attachments (2)

10020.diff (783 bytes) - added by Denis-de-Bernardy 12 years ago.
10020.2.diff (1.9 KB) - added by Denis-de-Bernardy 12 years ago.

Download all attachments as: .zip

Change History (7)

#1 @Denis-de-Bernardy
12 years ago

The second patch also adds a class to the save button.

It's nit-picking, but it allows to fix the following use-case:

  • widget has no options
  • fields get added
  • fields are irrelevant to a specific sidebar

Using trunk, I change $return in the control_callback. Using the patch, I no longer change it, and I add this instead:

.widget-control-noform {
	display: block;

#the_404 .widget-control-noform,
#inline_widgets .widget-control-noform,
#feed_widgets .widget-control-noform {
	display: none;

#2 @Denis-de-Bernardy
12 years ago

@andrew: either patch works, but at least one needs to get in there. else we end up needing to change the globals. :-)

#3 @Denis-de-Bernardy
12 years ago

  • Priority changed from normal to high

#4 @azaozz
12 years ago

Using css to hide the Save button is a good idea, however don't think more hooks are needed in WP_Widget. There seem to be too many as it is and each hook makes it run a little slower.

Plugins that add extra fields to each widget's form can append them under the original fields extending the form vertically. This would also require less js to be run on the admin page which would be a lot heavier with all the extra fields anyway.

#5 @azaozz
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11516]) Using css to hide the Save button in widgets without settings, props Denis-de-Bernardy, fixes #10020

Note: See TracTickets for help on using tickets.