diff --git src/wp-admin/customize.php src/wp-admin/customize.php
index d3b09f2..b1485d1 100644
|
|
do_action( 'customize_controls_print_scripts' ); |
118 | 118 | $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') ); |
119 | 119 | ?> |
120 | 120 | |
| 121 | <div id="widgets-right"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the customizer for compat --> |
121 | 122 | <div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1"> |
122 | 123 | <div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>"> |
123 | 124 | <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0"> |
… |
… |
do_action( 'customize_controls_print_scripts' ); |
146 | 147 | ?> |
147 | 148 | </ul></div> |
148 | 149 | </div> |
| 150 | </div> |
149 | 151 | |
150 | 152 | <div id="customize-footer-actions" class="wp-full-overlay-footer"> |
151 | 153 | <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> |
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index f0c1e8c..b28bba8 100644
|
|
var WidgetCustomizer = ( function ($) { |
35 | 35 | window.ajaxurl = wp.ajax.settings.url; |
36 | 36 | } |
37 | 37 | |
38 | | // Unfortunately many widgets try to look for instances under div#widgets-right, |
39 | | // so we have to add that ID to a container div in the customizer for compat |
40 | | $( '#customize-theme-controls' ).closest( 'div:not([id])' ).attr( 'id', 'widgets-right' ); |
41 | | |
42 | 38 | /** |
43 | 39 | * Set up model |
44 | 40 | */ |
diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php
index 335181f..e19006b 100644
|
|
final class WP_Customize_Widgets { |
78 | 78 | add_action( 'after_setup_theme', array( $this, 'setup_widget_addition_previews' ) ); |
79 | 79 | add_action( 'customize_controls_init', array( $this, 'customize_controls_init' ) ); |
80 | 80 | add_action( 'customize_register', array( $this, 'schedule_customize_register' ), 1 ); |
81 | | add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_deps' ) ); |
| 81 | add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
| 82 | add_action( 'customize_controls_print_styles', array( $this, 'print_styles' ) ); |
| 83 | add_action( 'customize_controls_print_scripts', array( $this, 'print_scripts' ) ); |
| 84 | add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_footer_scripts' ) ); |
82 | 85 | add_action( 'customize_controls_print_footer_scripts', array( $this, 'output_widget_control_templates' ) ); |
83 | 86 | add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); |
84 | 87 | |
… |
… |
final class WP_Customize_Widgets { |
517 | 520 | } |
518 | 521 | |
519 | 522 | /** |
| 523 | * Call admin_print_styles-widgets.php and admin_print_styles hooks. |
| 524 | * |
| 525 | * @since 3.9.0 |
| 526 | * @access public |
| 527 | */ |
| 528 | public function print_styles() { |
| 529 | /** This action is documented in wp-admin/admin-header.php */ |
| 530 | do_action( 'admin_print_styles-widgets.php' ); |
| 531 | |
| 532 | /** This action is documented in wp-admin/admin-header.php */ |
| 533 | do_action( 'admin_print_styles' ); |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Call admin_print_scripts-widgets.php and admin_print_scripts hooks. |
| 538 | * |
| 539 | * @since 3.9.0 |
| 540 | * @access public |
| 541 | */ |
| 542 | public function print_scripts() { |
| 543 | /** This action is documented in wp-admin/admin-header.php */ |
| 544 | do_action( 'admin_print_scripts-widgets.php' ); |
| 545 | |
| 546 | /** This action is documented in wp-admin/admin-header.php */ |
| 547 | do_action( 'admin_print_scripts' ); |
| 548 | } |
| 549 | |
| 550 | /** |
520 | 551 | * Enqueue scripts and styles for customizer panel and export data to JS. |
521 | 552 | * |
522 | 553 | * @since 3.9.0 |
523 | 554 | * @access public |
524 | 555 | */ |
525 | | public function customize_controls_enqueue_deps() { |
| 556 | public function enqueue_scripts() { |
526 | 557 | wp_enqueue_style( 'customize-widgets' ); |
527 | 558 | wp_enqueue_script( 'customize-widgets' ); |
528 | 559 | |
| 560 | /** This action is documented in wp-admin/admin-header.php */ |
| 561 | do_action( 'admin_enqueue_scripts', 'widgets.php' ); |
| 562 | |
529 | 563 | // Export available widgets with control_tpl removed from model |
530 | 564 | // since plugins need templates to be in the DOM |
531 | 565 | $available_widgets = array(); |
… |
… |
final class WP_Customize_Widgets { |
594 | 628 | } |
595 | 629 | |
596 | 630 | /** |
| 631 | * Call admin_print_footer_scripts and admin_print_scripts hooks. |
| 632 | * |
| 633 | * @since 3.9.0 |
| 634 | * @access public |
| 635 | */ |
| 636 | public function print_footer_scripts() { |
| 637 | /** This action is documented in wp-admin/admin-footer.php */ |
| 638 | do_action( 'admin_print_footer_scripts' ); |
| 639 | |
| 640 | /** This action is documented in wp-admin/admin-footer.php */ |
| 641 | do_action( 'admin_footer-widgets.php' ); |
| 642 | } |
| 643 | |
| 644 | /** |
597 | 645 | * Render the widget form control templates into the DOM so that plugin scripts can manipulate them |
598 | 646 | * |
599 | 647 | * @since 3.9.0 |