[wp-trac] [WordPress Trac] #35855: Let selective refresh component be required but be opt-in for sidebars/widgets (for now)

WordPress Trac noreply at wordpress.org
Mon Mar 21 05:04:02 UTC 2016

#35855: Let selective refresh component be required but be opt-in for
sidebars/widgets (for now)
 Reporter:  DrewAPicture             |       Owner:  westonruter
     Type:  task (blessed)           |      Status:  accepted
 Priority:  normal                   |   Milestone:  4.5
Component:  Customize                |     Version:  trunk
 Severity:  blocker                  |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:

Comment (by ryankienstra):

 '''Tested With 3 Themes'''
 ''Theme-Level Opt-In Works As Expected''

 The opt-in of the "Selective Refresh" feature works as @westonruter
 described it. The WordPress core themes now have an opt-in function
 cb8ecc93525ecf9347f507fb3ccb0926R231 call] for "Selective Refresh." And
 all of the core widgets refresh properly with this:

 "Archives," "Calendar," "Categories," "Custom Menu," "Meta," "Pages,"
 "Recent Comments," "Recent Posts," "RSS," "Search," "Tag Cloud," and

 While refreshing, they quickly became lighter, and update with the new
 content. They have no effect on the surrounding widgets or content. The
 rest of the page is exactly the same.

 When commenting out the theme-level [https://github.com/xwp/wordpress-
 develop/pull/144/files#diff-70824c0c03ec36b59fb60852857c75a0R118 opt-in
 code], "Selective Refresh" was disabled. The widgets reloaded as before,
 with a full-page refresh.

 I also tested disabling the widget-level opt-in for core widgets. For
 example, on in [https://github.com/xwp/wordpress-develop/pull/144/files
 #diff-fcee08630028b6773a4da7070ab659baR29 class-wp-widget-archives.php], I
 commented out `'customize_selective_refresh' => true,`. This had the
 intended effect of refreshing the entire page on a widget change. But the
 rest of the widgets still refreshed the same as before.

 And the same results occurred for this test on the [https://github.com/xwp
 wp-widget-pages.php] function with the theme
 [https://wordpress.org/themes/twentysixteen/ Twenty Sixteen].

 I tested this with @westonruter's commits to [https://github.com/xwp
 /wordpress-develop/pull/144/commits WordPress Core] and
 [https://github.com/xwp/twentysixteen/tree/trac-35855 Twenty Sixteen].
 Using these commits, I tested the themes
 [https://wordpress.org/themes/twentyfourteen/ Twenty Fourteen],
 [https://wordpress.org/themes/twentyfifteen/ Twenty Fifteen], and
 [https://wordpress.org/themes/twentysixteen/ Twenty Sixteen].

Ticket URL: <https://core.trac.wordpress.org/ticket/35855#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list