Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xlplugins/c90e5672da916c7c2d51ef06921d9040 to your computer and use it in GitHub Desktop.
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
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