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
This commit is contained in:
Weston Ruter 2017-10-28 06:36:12 +00:00
parent 01bb1fd6cb
commit f9472e94b8
1 changed files with 8 additions and 2 deletions

View File

@ -1302,7 +1302,10 @@
template = wp.template( 'customize-' + container.containerType + '-default' ); template = wp.template( 'customize-' + container.containerType + '-default' );
} }
if ( template && container.container ) { if ( template && container.container ) {
return $.trim( template( container.params ) ); return $.trim( template( _.extend(
{ id: container.id },
container.params
) ) );
} }
return '<li></li>'; return '<li></li>';
@ -2968,7 +2971,10 @@
template = wp.template( 'customize-panel-default-content' ); template = wp.template( 'customize-panel-default-content' );
} }
if ( template && panel.headContainer ) { if ( template && panel.headContainer ) {
panel.contentContainer.html( template( panel.params ) ); panel.contentContainer.html( template( _.extend(
{ id: panel.id },
panel.params
) ) );
} }
} }
}); });