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

WordPress Trac noreply at wordpress.org
Sun Mar 31 00:50:00 UTC 2019


#45029: Changes by widget_{$this->id_base}_instance_schema  are overridden by sub
class.
-------------------------------------------------+-------------------------
 Reporter:  Toro_Unit                            |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.2
Component:  Widgets                              |     Version:  4.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by birgire):

 The patch in [attachment:"45029.patch"] applies cleanly on my test install
 and the widgets tests run successfully.

 The patch seems to correctly reverse the {{{array_merge( $some_options,
 $defaults )}}} to {{{array_merge( $defaults, $some_options )}}}.

 We e.g. compare it with {{{wp_parse_args( $options, $defaults )}}}, that's
 a wrapper of {{{array_merge( $defaults, $options )}}}.

 In [attachment:"45029-2.diff"] I added the filtering into it's own test
 method, with some minor adjustments, like:

 - Ticket reference.
 - Some extra commenting on what the default values are that are going to
 be overridden by the filtering.
 - {{{@since}}} on the filter callbacks.

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


More information about the wp-trac mailing list