[wp-trac] [WordPress Trac] #45029: Changes by widget_{$this->id_base}_instance_schema are overridden by sub class.

WordPress Trac noreply at wordpress.org
Wed Oct 3 01:27:12 UTC 2018


#45029: Changes by widget_{$this->id_base}_instance_schema  are overridden by sub
class.
--------------------------+-----------------------------
 Reporter:  Toro_Unit     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  4.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 `WP_Widget_Media::get_instance_schema` has
 `"widget_{$this->id_base}_instance_schema"` filter.

 * `WP_Widget_Media_Image::get_instance_schema`
 * `WP_Widget_Media_Video::get_instance_schema`
 *  `WP_Widget_Media_Audio::get_instance_schema`

 are using array_marge. like this.

 {{{#!php
 $schema = array_merge(
                         parent::get_instance_schema(),
                         array(
                                 // setting for widgets.
                         )
                 );
 }}}

 So, Change by the filter, if same key exist, overwritten.

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


More information about the wp-trac mailing list