[wp-trac] [WordPress Trac] #36772: Widget from deactivated plugin still has its position in a sidebar

WordPress Trac noreply at wordpress.org
Mon Jun 19 14:52:09 UTC 2017


#36772: Widget from deactivated plugin still has its position in a sidebar
-------------------------------------------------+-------------------------
 Reporter:  afercia                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Widgets                              |  Review
 Severity:  normal                               |     Version:
 Keywords:  has-screenshots has-patch dev-       |  Resolution:
  feedback                                       |     Focuses:
-------------------------------------------------+-------------------------
Changes (by welcher):

 * keywords:  has-screenshots => has-screenshots has-patch dev-feedback


Comment:

 `sidebars_widgets` stores an array of sidebar ID's which is another array
 with the widget instance id for each widget assigned to that sidebar id.

 To my knowledge, there is no simple way to retrieve a list of registered
 `id_base`'s so I've added a new array to the widget factory that tracks
 the `id_base` for each registered widget class. Using that and the
 `sidebars_widgets` filter, we are able to remove any instances of
 unregistered widgets.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36772#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list