• Thank you very much for offering this! Only thing is, I wanted to dequeue the CSS and integrate it into my main CSS file. I’m using the following child class, can you suggest anything sleeker?


    class DequeueCFStyle extends ContactForm7ConditionalFields {

    private static $instance;

    public static function get_instance() {
    if ( empty( self::$instance ) ) {
    self::$instance = new self;
    }
    return self::$instance;
    }

    function __construct() {
    remove_action('wpcf7_enqueue_styles', array( 'ContactForm7ConditionalFields', 'enqueue_css'));
    }

    }
    DequeueCFStyle::get_instance();

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Hi Little Package, thank you for the great review!

    I’m not sure if it’s sleeker but can’t you simply dequeue the style like this?

    add_action( 'wp_enqueue_scripts', 'remove_wpcf7cf_stylesheet', 20 );
    function remove_wpcf7cf_stylesheet() {
      wp_dequeue_style('cf7cf-style');
    }
    

    I haven’t tested this, but I believe it should work.

    Thread Starter Little Package

    (@littlepackage)

    Hi @jules-colle,

    I had tried something simple like that and it didn’t work… not sure why I needed to make it so complicated! Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Stellar’ is closed to new replies.