[wp-trac] [WordPress Trac] #36703: Correct method override information in WP_Widget class documentation

WordPress Trac noreply at wordpress.org
Thu Apr 28 18:59:02 UTC 2016


#36703: Correct method override information in WP_Widget class documentation
--------------------------+-----------------------------
 Reporter:  Frank Klein   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  2.8
 Severity:  normal        |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 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()`:
 1. WordPress does not enforce the overriding for these methods, as it does
 for `WP_Widget::widget()`.
 2. 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36703>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list