Changeset 42613 for trunk/src/wp-includes/widgets/class-wp-widget-text.php
- Timestamp:
- 01/29/2018 11:55:44 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-text.php
r42545 r42613 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(). … … 392 396 393 397 return $instance; 398 } 399 400 /** 401 * Enqueue preview scripts. 402 * 403 * These scripts normally are enqueued just-in-time when a playlist shortcode is used. 404 * However, in the customizer, a playlist shortcode may be used in a text widget and 405 * dynamically added via selective refresh, so it is important to unconditionally enqueue them. 406 * 407 * @since 4.9.3 408 */ 409 public function enqueue_preview_scripts() { 410 require_once dirname( dirname( __FILE__ ) ) . '/media.php'; 411 412 wp_playlist_scripts( 'audio' ); 413 wp_playlist_scripts( 'video' ); 394 414 } 395 415
Note: See TracChangeset
for help on using the changeset viewer.