• Resolved Haca

    (@webwow)


    The plugin adds inline styles to all the pages of the website, Even if it doesn’t contain a CF7 form.
    this ads unnecessary code that i want to remove on pages without a form.

    i already has a script that checks for the CF7 shortcode:

    add_action('wp_print_scripts', function () {
    	global $post;
    	if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'contact-form-7') ) {
    		wp_dequeue_script( 'google-recaptcha' );
    		wp_dequeue_script( 'wpcf7-recaptcha' );
    	}
    });

    i tried to add
    wp_dequeue_script( 'cf7-material-design-inline' );
    and
    wp_dequeue_style( 'cf7-material-design-inline' );

    but not of that worked.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Disable inline styles on all pages’ is closed to new replies.