Support » Plugin: Contact Form 7 - Post Fields » Remove dependency on dashicons

  • sermalefico

    (@sermalefico)


    How to remove dependency on dashicons. There is any function?
    In my web when eliminate dashicons because i use font awesome with

    
    add_action( 'wp_print_styles', function() {
        if (!is_admin_bar_showing()) wp_deregister_style( 'dashicons' );
    }, 100);
    

    in frontend my select fields lost all CSS

    can you help me thx!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    Hello sermalefico,
    you can do this with wp_deregister_style in your functions.php:

    add_action( 'wpcf7_enqueue_styles', 'wpcf7_change_stylesheet', 20 );
    
    function wpcf7_change_stylesheet(){
        wp_deregister_style( 'wpcf7-select2' );
    	wp_deregister_style( 'wpcf7-post-image-checkbox' );
     
        wp_register_style( 'wpcf7-select2', plugin_dir_url(WPCF7_POST_FIELDS_PLUGIN).'assets/css/wpcf7-post-image-checkbox.css' );
    	wp_register_style( 'wpcf7-post-image-checkbox', plugin_dir_url(WPCF7_POST_FIELDS_PLUGIN).'assets/select2/select2.css' );
    }

    Works with the new plugin version.

    Best regads
    Markus

    Thread Starter sermalefico

    (@sermalefico)

    mnmnmn i understand i only want remove the dashicons in frontend because is 50k not the entire style of select

    i deregister dashicons and register and enqueue the post fields but when dashicons is deregister post fields css dont apply. Select fields lose all css but the CSS styles are load

    add_action( ‘wpcf7_enqueue_styles’, ‘wpcf7_change_stylesheet’, 100 );
    function wpcf7_change_stylesheet() {
    if ( ! is_user_logged_in() ) {
    wp_dequeue_style( ‘dashicons’ );
    wp_deregister_style( ‘dashicons’ );
    wp_register_style( ‘wpcf7-select2′, plugin_dir_url(WPCF7_POST_FIELDS_PLUGIN).’assets/css/wpcf7-post-image-checkbox.css’ );
    wp_register_style( ‘wpcf7-post-image-checkbox’, plugin_dir_url(WPCF7_POST_FIELDS_PLUGIN).’assets/select2/select2.css’ );
    }
    }

    Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    You can also try the plugin Assets Cleaner.
    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove dependency on dashicons’ is closed to new replies.