如何去除woocommerce 3.7 裏的 var wc_product_block_data = JSON.parse( decodeURIComponent( 代碼

把下面這段代碼添加到模板下的 functions.php 裏:

add_action('wp_footer','wooexperts_remove_block_data',0); add_action('admin_enqueue_scripts','wooexperts_remove_block_data',0); function wooexperts_remove_block_data(){ remove_filter('wp_print_footer_scripts',array('Automattic\WooCommerce\Blocks\Assets','print_script_block_data'),1); remove_filter('admin_print_footer_scripts',array('Automattic\WooCommerce\Blocks\Assets','print_script_block_data'),1); }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章