Opened 8 years ago
Closed 8 years ago
#36703 closed defect (bug) (fixed)
Correct method override information in WP_Widget class documentation
Reported by: | Frank Klein | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
The documentation at the top of the WP_Widget
class file currently states:
This class must be extended for each widget and WP_Widget::widget(), WP_Widget::update() and WP_Widget::form() need to be overridden.
I'd say that this is probably not correct for WP_Widget::update()
and WP_Widget::form()
:
- WordPress does not enforce the overriding for these methods, as it does for
WP_Widget::widget()
. - To have a widget without settings, not overriding these methods seems like the correct approach, as demonstrated by the contents of the
WP_Widget::form()
method.
I propose to rework the documentation to clarify this.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hi @Frank-Klein, thanks for the patch!