Adding Additional Attributes in Script Tag for 3rd party JS
you can try to use the script_loader_src filter hook e.g: add_filter(‘script_loader_src’,’add_id_to_script’,10,2); function add_id_to_script($src, $handle){ if ($handle != ‘dropbox.js’) return $src; return $src.”‘ id=’dropboxjs’ data-app-key=’MY_APP_KEY”; } Update i just figured it out myself that the src is escaped by esc_url, so looking a bit more i found the clean_url filter which you can use to return … Read more