Widget Customizer: Improve plugin compatibility.

Some plugins are using custom scripts and styles for there widgets. These are available on the Widgets screens, but not in the Customizer yet.
Scripts and styles can be enqueued via: 
* `admin_enqueue_scripts`
* `admin_print_scripts` and `admin_print_scripts-widgets.php`
* `admin_print_styles` and `admin_print_styles-widgets.php`
* `admin_print_footer_scripts` and `admin_footer-widgets.php`
All this hooks are now called in the Customizer too.

Previously we have add the `#widgets-right` ID to a container div via jQuery. Remember: `#widgets-right` exists on the Widgets screen and is used by many plugins to do event delegation from that element.
But since our script files are loaded in the footer, the JavaScript way is a bit late for some plugins.
We have decided to add a `div#widgets-right` container element to customizer. "Less hacky hack."

props westonruter, ocean90. Thanks dpe415 for testing.
fixes #27619.
Built from https://develop.svn.wordpress.org/trunk@27907


git-svn-id: http://core.svn.wordpress.org/trunk@27738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling
2014-04-02 17:04:14 +00:00
parent 61289de08d
commit cde6d602ea
4 changed files with 56 additions and 7 deletions

View File

@@ -118,6 +118,7 @@ do_action( 'customize_controls_print_scripts' );
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
?>
<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 -->
<div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1">
<div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
<div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
@@ -146,6 +147,7 @@ do_action( 'customize_controls_print_scripts' );
?>
</ul></div>
</div>
</div>
<div id="customize-footer-actions" class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">