This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_package_rates', 'ras_custom_shipping_costs', 20, 2 ); | |
| function ras_custom_shipping_costs( $rates, $package ) { | |
| $weights_prices_field = get_field('shipping_weights', 'options'); | |
| $weights_prices = []; | |
| foreach ($weights_prices_field as $weights_price) { | |
| $weights_prices[floatval($weights_price['weight'])] = floatval($weights_price['price']); | |
| } | |
| foreach( $rates as $rate_key => $rate ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // disable Gutenberg for posts | |
| add_filter('use_block_editor_for_post', '__return_false', 10); | |
| // disable Gutenberg for post types | |
| add_filter('use_block_editor_for_page', '__return_false', 10); | |
| add_filter('should_load_block_editor_scripts_and_styles', '__return_false', 10); | |
| remove_theme_support( 'editor-color-palette' ); | |
| remove_theme_support( 'wp-block-styles' ); | |
| remove_theme_support( 'core-block-patterns' ); | |
| remove_theme_support( 'editor-gradient-presets' ); | |
| remove_theme_support( 'editor-font-sizes' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'block_editor_settings' , [$this, 'remove_guten_wrapper_styles'] ); | |
| // disable Gutenberg for posts | |
| add_filter('use_block_editor_for_post', '__return_false', 10); | |
| // disable Gutenberg for post types | |
| add_filter('use_block_editor_for_page', '__return_false', 10); | |
| add_filter('should_load_block_editor_scripts_and_styles', '__return_false', 10); | |
| remove_theme_support( 'editor-color-palette' ); | |
| remove_theme_support( 'wp-block-styles' ); | |
| remove_theme_support( 'core-block-patterns' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function remove_guten_wrapper_styles(){ | |
| wp_dequeue_style( 'wp-block-library' ); | |
| wp_dequeue_style( 'wp-block-library-theme' ); | |
| wp_dequeue_style( 'wc-block-style' ); // REMOVE WOOCOMMERCE BLOCK CSS | |
| wp_dequeue_style( 'global-styles' ); // REMOVE THEME.JSON | |
| } |
OlderNewer