Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter mariohillemann

    (@mariohillemann)

    I found an answer by myself:

    1.

    add_filter( 'wpcf7_load_css', '__return_false' );
    add_filter( 'wpcf7_load_js', '__return_false' );

    2.

    function custom_jquery() {
      if (!is_admin()) {
       	
        wp_enqueue_script('jquery');
        wp_enqueue_script('jquery-migrate');
    
        // IF CF7 IS LOADED
        if (is_page('contact')) {
          wpcf7_enqueue_scripts();
          wp_enqueue_script( 'require-js', get_stylesheet_directory_uri(). '/js/require.min.js', array( 'jquery', 'jquery-migrate','contact-form-7' ) );
        } else {
          wp_enqueue_script( 'require-js', get_stylesheet_directory_uri(). '/js/require.min.js', array( 'jquery', 'jquery-migrate' ) );
        }
      }   
    }
    add_action('wp_enqueue_scripts', 'custom_jquery');

    So there is an dependency for require-js, not for cf7.
    This is not the best solution, for example there is another plugin, wich needs an deps, but if there is one in a projekt, I can add this too like this above…

Viewing 1 replies (of 1 total)