ฉันไม่สามารถเพิ่มแท็กที่เลื่อนออกไปในปลั๊กอินจาวาสคริปต์ การทดสอบหน้าเว็บสำหรับนักพัฒนาซอฟต์แวร์ของ Google แนะนำให้ฉันเพิ่มแท็กที่เลื่อนออกไปในรูปแบบการติดต่อ 7 javascripts
นี่คือวิธีที่ฟอร์มการติดต่อ 7 รวมถึงจาวาสคริปต์ในส่วนหัว
add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_scripts' );
function wpcf7_enqueue_scripts() {
    // jquery.form.js originally bundled with WordPress is out of date and deprecated
    // so we need to deregister it and re-register the latest one
    wp_deregister_script( 'jquery-form' );
    wp_register_script( 'jquery-form', wpcf7_plugin_url( 'jquery.form.js' ),
        array( 'jquery' ), '2.52', true );
    $in_footer = true;
    if ( 'header' === WPCF7_LOAD_JS )
        $in_footer = false;
    wp_enqueue_script( 'contact-form-7', wpcf7_plugin_url( 'scripts.js' ),
        array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );
    do_action( 'wpcf7_enqueue_scripts' );
}
ตอนนี้วิธีเพิ่มแท็กdefer = "defer"ในโค้ดด้านบน
                
                2
              
                  ตั๋วที่เกี่ยวข้อง: core.trac.wordpress.org/ticket/12009
                
                
                  
                    —
                    scribu 
                    
                  
                
              
                  คำถามที่ดี @Viruthagiri
                
                
                  
                    —
                    Ramkumar M