/**
* Export data from PHP to JS.
*
* @since 4.3.0
* @access public
*/
public function export_preview_data()
{
// Why not wp_localize_script? Because we're not localizing, and it forces values into strings.
$exports = array('renderQueryVar' => self::RENDER_QUERY_VAR, 'renderNonceValue' => wp_create_nonce(self::RENDER_AJAX_ACTION), 'renderNoncePostKey' => self::RENDER_NONCE_POST_KEY, 'requestUri' => '/', 'theme' => array('stylesheet' => $this->manager->get_stylesheet(), 'active' => $this->manager->is_theme_active()), 'previewCustomizeNonce' => wp_create_nonce('preview-customize_' . $this->manager->get_stylesheet()), 'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args);
if (!empty($_SERVER['REQUEST_URI'])) {
$exports['requestUri'] = esc_url_raw(home_url(wp_unslash($_SERVER['REQUEST_URI'])));
}
printf('<script>var _wpCustomizePreviewNavMenusExports = %s;</script>', wp_json_encode($exports));
}