From 8eb9b09fd52627414323217e63b688c9c59977e2 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 7 Sep 2015 06:27:11 +0000 Subject: [PATCH] Customizer: Prevent JS error during init when `nav_menus` panel is removed by plugin. Cherry-picks [33753] onto 4.3 branch. Fixes #33411 for 4.3. git-svn-id: https://develop.svn.wordpress.org/branches/4.3@33943 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-nav-menus.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js index e315019b9c..f5296b65d2 100644 --- a/src/wp-admin/js/customize-nav-menus.js +++ b/src/wp-admin/js/customize-nav-menus.js @@ -119,6 +119,10 @@ initialize: function() { var self = this; + if ( ! api.panel.has( 'nav_menus' ) ) { + return; + } + this.$search = $( '#menu-items-search' ); this.sectionContent = this.$el.find( '.accordion-section-content' );