Created
April 1, 2026 06:40
-
-
Save xlplugins/d509daf41466055dc1d18a47f8142000 to your computer and use it in GitHub Desktop.
WeddingTropics theme
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
| <?php | |
| /** | |
| * Dequeue conflicting WeddingTropics theme assets on FunnelKit Checkout page | |
| */ | |
| add_action( 'init', function() { | |
| if ( ! class_exists( 'Custom_FunnelKit_Dequeue' ) ) { | |
| class Custom_FunnelKit_Dequeue { | |
| public function __construct() { | |
| add_action( 'wfacp_after_checkout_page_found', array( $this, 'dequeue_actions' ) ); | |
| } | |
| public function dequeue_actions() { | |
| // Fix: vc_remove_wp_ver_css_js breaks FunnelKit assets | |
| if ( function_exists( 'vc_remove_wp_ver_css_js' ) ) { | |
| remove_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 999999 ); | |
| remove_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 999999 ); | |
| } | |
| $this->dequeue_theme_assets(); | |
| } | |
| public function dequeue_theme_assets() { | |
| // Dequeue styles | |
| wp_dequeue_style( 'bootstrap-css' ); | |
| wp_dequeue_style( 'tropics-style' ); | |
| wp_dequeue_style( 'tropics-woocommerce' ); | |
| wp_dequeue_style( 'tropics-wSelect' ); | |
| wp_dequeue_style( 'datepicker-css' ); | |
| wp_dequeue_style( 'owl-style' ); | |
| // Dequeue scripts | |
| wp_dequeue_script( 'bootstrap-js' ); | |
| wp_dequeue_script( 'country-select' ); | |
| wp_dequeue_script( 'woo-custom-js' ); | |
| wp_dequeue_script( 'datepicker-custom-js' ); | |
| wp_dequeue_script( 'owl-js' ); | |
| wp_dequeue_script( 'tropics-scripts' ); | |
| // Ensure WooCommerce selectWoo is available | |
| if ( ! wp_script_is( 'selectWoo', 'registered' ) && function_exists( 'WC' ) ) { | |
| $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
| wp_register_script( | |
| 'selectWoo', | |
| WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', | |
| array( 'jquery' ), | |
| '1.0.6', | |
| true | |
| ); | |
| } | |
| if ( ! wp_style_is( 'select2', 'registered' ) && function_exists( 'WC' ) ) { | |
| $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
| wp_register_style( | |
| 'select2', | |
| WC()->plugin_url() . '/assets/css/select2' . $suffix . '.css', | |
| array(), | |
| '1.0.6' | |
| ); | |
| } | |
| } | |
| } | |
| new Custom_FunnelKit_Dequeue(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment