GC_Customize_Nav_Menus::export_preview_data()
最后更新于:2021-11-27 04:03:16
GC_Customize_Nav_Menus::export_preview_data()Exports data from PHP to JS.
源文件
文件: gc-includes/class-gc-customize-nav-menus.php
public function export_preview_data() {
// Why not gc_localize_script? Because we're not localizing, and it forces values into strings.
$exports = array(
'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args,
);
printf( '<script>var _gcCustomizePreviewNavMenusExports = %s;</script>', gc_json_encode( $exports ) );
}