Created
August 28, 2020 16:10
-
-
Save brianleejackson/0e11148e30a650d5a8022e5ae6f030f9 to your computer and use it in GitHub Desktop.
Disable Font Awesome in YITH WooCommerce Wishlist
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
if ( function_exists( 'yith_wishlist_install' ) ){ | |
if ( ! function_exists( 'yith_wcwl_remove_awesome_stylesheet' ) ) { | |
function yith_wcwl_remove_awesome_stylesheet() { | |
wp_deregister_style( 'yith-wcwl-font-awesome' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'yith_wcwl_remove_awesome_stylesheet', 20 ); | |
} |
@DeoThemes, it could be that something has changed. The code above was actually provided by their support team. https://wordpress.org/support/topic/fontawesome-9/
Yes, it's no longer working. Will try to find another way. Thanks.
@DeoThemes Sounds good. If you find an alternative, feel free to drop in a comment here if you have the time. Happy to update my gist.
@brianleejackson The only way I found is to dequeue font-awesome styles first and then enqueue the rest of the styles again. I'm not sure if it's the best solution and it will not break any code, but for me it's working, I have all the wishlist CSS styles except FontAwesome. So here is the code:
if ( defined( 'YITH_WCWL' ) ) {
function yith_wcwl_dequeue_font_awesome_styles() {
wp_deregister_style( 'woocommerce_prettyPhoto_css' );
wp_deregister_style( 'jquery-selectBox' );
wp_deregister_style( 'yith-wcwl-font-awesome' );
wp_deregister_style( 'yith-wcwl-main' );
$assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';
wp_register_style( 'jquery-selectBox', YITH_WCWL_URL . 'assets/css/jquery.selectBox.css', array(), '1.2.0' );
wp_register_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );
wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox' ), '1.0.0' );
}
add_action( 'wp_enqueue_scripts', 'yith_wcwl_dequeue_font_awesome_styles', 11 );
}
@DeoThemes, great! Thanks for taking the time to share what's working for you.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem with this script it also dequeues main Wishlist style CSS, since the font-awesome is listed as a dependency.