Last active
April 16, 2025 04:57
-
-
Save xlplugins/c90e5672da916c7c2d51ef06921d9040 to your computer and use it in GitHub Desktop.
Dequeue Theme specific CSS or JS on Funnelkit Checkout Final 16 April 2025
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
class WFACP_Theme_Dequeue_Specific_CSS_JS { | |
private $handler = [ | |
'augury-woo-default', | |
'augury-woo', | |
]; | |
public function __construct() { | |
add_action( 'wfacp_after_checkout_page_found', [ $this, 'action' ] ); | |
} | |
public function action() { | |
add_action( 'wp_enqueue_scripts', function () { | |
try { | |
if ( is_array( $this->handler ) && count( $this->handler ) > 0 ) { | |
foreach ( $this->handler as $k => $handle_name ) { | |
wp_deregister_style( $handle_name ); | |
wp_dequeue_style( $handle_name ); | |
} | |
} | |
} catch ( Exception $e ) { | |
// Log the error or handle it appropriately | |
error_log( 'WFACP Style Dequeue Error: ' . $e->getMessage() ); | |
} | |
}, 9999 ); | |
} | |
} | |
new WFACP_Theme_Dequeue_Specific_CSS_JS(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment