Last active
February 18, 2016 04:55
-
-
Save DrewAPicture/c98e39c17437388408cd to your computer and use it in GitHub Desktop.
Re-adding core menus and widgets panels back if removed via 'customizer_loaded_components' hook. Note rehooking the nav menus customize_register() method at a later priority.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); | |
$this->wp_customize->widgets = new WP_Customize_Widgets( $this->wp_customize ); | |
require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' ); | |
$this->wp_customize->nav_menus = new WP_Customize_Nav_Menus( $this->wp_customize ); | |
// Restore setup for nav menus (normally hooked at priority 11). | |
add_action( 'customize_register', array( $this->wp_customize->nav_menus, 'customize_register' ), 501 ); | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment