- Timestamp:
- 01/30/2018 02:55:25 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
- Property svn:mergeinfo changed
/trunk merged: 42613,42617
- Property svn:mergeinfo changed
-
branches/4.9/src/wp-includes/widgets/class-wp-widget-text.php
r42546 r42622 57 57 58 58 wp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) ); 59 60 if ( $this->is_preview() ) { 61 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) ); 62 } 59 63 60 64 // Note that the widgets component in the customizer will also do the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). … … 388 392 389 393 return $instance; 394 } 395 396 /** 397 * Enqueue preview scripts. 398 * 399 * These scripts normally are enqueued just-in-time when a playlist shortcode is used. 400 * However, in the customizer, a playlist shortcode may be used in a text widget and 401 * dynamically added via selective refresh, so it is important to unconditionally enqueue them. 402 * 403 * @since 4.9.3 404 */ 405 public function enqueue_preview_scripts() { 406 require_once dirname( dirname( __FILE__ ) ) . '/media.php'; 407 408 wp_playlist_scripts( 'audio' ); 409 wp_playlist_scripts( 'video' ); 390 410 } 391 411
Note: See TracChangeset
for help on using the changeset viewer.