WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #32417, comment 103


Ignore:
Timestamp:
02/20/2017 08:21:16 PM (16 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32417, comment 103

    initial v1  
    33
    44In the plugin form, what you have is good. However, for the core merge this logic should actually be part of `selective-refresh.js` itself as was done for emoji, toward the end of this snippet: https://github.com/WordPress/wordpress-develop/blob/4.7.2/src/wp-includes/js/customize-selective-refresh.js#L425-L454
    5 
    6 Something like:
    7 
    8 {{{#!js
    9 wp.mediaelement.initialize(  );
    10 }}}
    11 
    125
    136Now, I believe an early iteration of selective refresh actually did include auto-initialization of media elements. However, it was removed due to complexities in regards to initialization which can be seen in the Jetpack infinite-scroll module. There may be other use cases in the Jetpack module that can be gleaned from for various edge cases: https://github.com/Automattic/jetpack/blob/master/modules/infinite-scroll/infinity.js