?>
<script type="text/javascript">
var _wpCustomizeSettings = <?php
echo wp_json_encode( $settings ); ?>;
_wpCustomizeSettings.initialClientTimestamp = _.now();
_wpCustomizeSettings.controls = {};
_wpCustomizeSettings.settings = {};
<?php
// Serialize settings one by one to improve memory usage.
echo "(function ( s ){\n";
foreach ( $this->
settings() as $setting ) { if ( $setting->
check_capabilities() ) { printf( "s[%s] = %s;\n",
wp_json_encode( $setting->id
),
wp_json_encode( $setting->
json() ) );
} } echo "})( _wpCustomizeSettings.settings );\n";
// Serialize controls one by one to improve memory usage.