From f9472e94b8208e000f49edc6344200bf1e48725c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 28 Oct 2017 06:36:12 +0000 Subject: [PATCH] Customize: Ensure `id` for section and panel is passed among `params` to respective templates. Fixes issue where JS-added Publish Settings section failed to get container element ID set properly to hide its section-meta. Amends [42025]. See #42337, #42083. git-svn-id: https://develop.svn.wordpress.org/trunk@42035 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/customize-controls.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 96a0fb0bb6..764d787857 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -1302,7 +1302,10 @@ template = wp.template( 'customize-' + container.containerType + '-default' ); } if ( template && container.container ) { - return $.trim( template( container.params ) ); + return $.trim( template( _.extend( + { id: container.id }, + container.params + ) ) ); } return '
  • '; @@ -2968,7 +2971,10 @@ template = wp.template( 'customize-panel-default-content' ); } if ( template && panel.headContainer ) { - panel.contentContainer.html( template( panel.params ) ); + panel.contentContainer.html( template( _.extend( + { id: panel.id }, + panel.params + ) ) ); } } });