Horje
defer parsing of javascript wordpress Code Example
defer parsing of javascript wordpress
// Only for Javascript

function defer_parsing_of_js( $url ) {
    if ( is_user_logged_in() ) return $url; //don't break WP Admin
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );




Javascript

Related
missing from-clause entry for table sequelize limit Code Example missing from-clause entry for table sequelize limit Code Example
Stored procedure with EF core Code Example Stored procedure with EF core Code Example
get input type js Code Example get input type js Code Example
vue test form input Code Example vue test form input Code Example
concatenate a variable inside text react native Code Example concatenate a variable inside text react native Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6