mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Add JS templates for Customizer Panels and Sections.
This extends the approach taken for Customizer Controls in #29572. Props celloexpressions, westonruter, ocean90. See #30737. git-svn-id: https://develop.svn.wordpress.org/trunk@32658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -175,7 +175,9 @@ do_action( 'customize_controls_print_scripts' );
|
||||
<div id="customize-preview" class="wp-full-overlay-main"></div>
|
||||
<?php
|
||||
|
||||
// Render control templates.
|
||||
// Render Panel, Section, and Control templates.
|
||||
$wp_customize->render_panel_templates();
|
||||
$wp_customize->render_section_templates();
|
||||
$wp_customize->render_control_templates();
|
||||
|
||||
/**
|
||||
@@ -259,28 +261,38 @@ do_action( 'customize_controls_print_scripts' );
|
||||
|
||||
// Prepare Customize Setting objects to pass to JavaScript.
|
||||
foreach ( $wp_customize->settings() as $id => $setting ) {
|
||||
$settings['settings'][ $id ] = array(
|
||||
'value' => $setting->js_value(),
|
||||
'transport' => $setting->transport,
|
||||
'dirty' => $setting->dirty,
|
||||
);
|
||||
if ( $setting->check_capabilities() ) {
|
||||
$settings['settings'][ $id ] = array(
|
||||
'value' => $setting->js_value(),
|
||||
'transport' => $setting->transport,
|
||||
'dirty' => $setting->dirty,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare Customize Control objects to pass to JavaScript.
|
||||
foreach ( $wp_customize->controls() as $id => $control ) {
|
||||
$settings['controls'][ $id ] = $control->json();
|
||||
if ( $control->check_capabilities() ) {
|
||||
$settings['controls'][ $id ] = $control->json();
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare Customize Section objects to pass to JavaScript.
|
||||
foreach ( $wp_customize->sections() as $id => $section ) {
|
||||
$settings['sections'][ $id ] = $section->json();
|
||||
if ( $section->check_capabilities() ) {
|
||||
$settings['sections'][ $id ] = $section->json();
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare Customize Panel objects to pass to JavaScript.
|
||||
foreach ( $wp_customize->panels() as $id => $panel ) {
|
||||
$settings['panels'][ $id ] = $panel->json();
|
||||
foreach ( $panel->sections as $section_id => $section ) {
|
||||
$settings['sections'][ $section_id ] = $section->json();
|
||||
foreach ( $wp_customize->panels() as $panel_id => $panel ) {
|
||||
if ( $panel->check_capabilities() ) {
|
||||
$settings['panels'][ $panel_id ] = $panel->json();
|
||||
foreach ( $panel->sections as $section_id => $section ) {
|
||||
if ( $section->check_capabilities() ) {
|
||||
$settings['sections'][ $section_id ] = $section->json();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user