[wp-trac] [WordPress Trac] #36389: Selective refresh for widgets gets lost once `refresh` is used

WordPress Trac noreply at wordpress.org
Tue Apr 5 21:40:08 UTC 2016


#36389: Selective refresh for widgets gets lost once `refresh` is used
-------------------------------------------------+-------------------------
 Reporter:  scamartist26                         |       Owner:
     Type:  defect (bug)                         |  westonruter
 Priority:  normal                               |      Status:  accepted
Component:  Customize                            |   Milestone:  4.5
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch has-unit-tests commit      |  Resolution:
  needs-docs                                     |     Focuses:
-------------------------------------------------+-------------------------

Comment (by DrewAPicture):

 Replying to [comment:20 westonruter]:
 > Replying to [comment:18 DrewAPicture]:
 > > Side note: I recognize why we need it in core, but it definitely feels
 a little weird adding a method specifically for testing purposes. Like
 maybe the underlying code isn't flexible enough in its implementation to
 be easily testable in the first place. I register my hesitation to make
 this a habit.
 >
 > You're absolutely right. See my
 [https://core.trac.wordpress.org/ticket/36389#comment:13 comment above]:
 >
 > > Adding unit tests also necessitated introducing a static
 `WP_Customize_Setting::reset_aggregated_multidimensionals()` to reset the
 protected static `$aggregated_multidimensionals` variable after each test.
 (In hindsight, it may have been better to store the
 `$aggregated_multidimensionals` as a non-static variable on
 `WP_Customize_Manager` so that it would be cleaned up automatically after
 the manager is destructed.)
 >
 > So, what should be done specifically to prevent this method from being
 included in docs? Let it be like it is right now, but include `@ignore`?

 Yep, just add an `@ignore` tag in there. And I'd change the description
 from "This is used by unit tests. It should not be used generally." to the
 more explicit "This is intended only for use by unit tests."

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


More information about the wp-trac mailing list