[wp-trac] [WordPress Trac] #35981: Convert WP_Widget into an abstract class

WordPress Trac noreply at wordpress.org
Sun Feb 28 02:06:51 UTC 2016


#35981: Convert WP_Widget into an abstract class
-------------------------+-----------------------------
 Reporter:  johnbillion  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  low          |  Milestone:  Awaiting Review
Component:  Widgets      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 [https://core.trac.wordpress.org/browser/tags/4.4.2/src/wp-includes/class-
 wp-widget.php?marks=101,102,103#L89 The WP_Widget::widget() method] is,
 for all incense and porpoises, an abstract method without actually being
 abstract. It contains a call to `wp_die()` with an instructional message
 stating that it must be overridden in a subclass, and a widget does not
 operate without this method (it's used for the widget output).

 This method should be a real abstract method, and this, so should the
 `WP_Widget` class. That way, we can remove one more piece of janky code
 from WordPress.

 I scanned the plugin and theme directories for instances of `new
 WP_Widget()` and found zero instances, so I predict breakage to be low to
 non-existent.

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


More information about the wp-trac mailing list