Serving wp-includes (front-end) javascript from a different domain?

Okay, I’ve tried numerous (literally) codes and methods, and failed miserably. So, like I said in the question, the only safe way seems to be re-registering (unregistering and enqueuing) the scripts. The Scripts: http://mywebsite.com/wp-includes/js/comment-reply.js http://mywebsite.com/wp-includes/js/quicktags.js Should be served from: http://example.com/wp-includes/js/comment-reply.js http://example.com/wp-includes/js/quicktags.js Code in functions.php: add_action(‘wp_enqueue_scripts’,’wpse56742_register_script’); function wpse56742_register_script(){ //Register and enqueue Comment Reply script wp_deregister_script(‘comment-reply’); wp_register_script(‘comment-reply’, … Read more

Listing registered scripts

There’s a global variable called $wp_scripts which is an instance of the WP_Scripts class. It doesn’t have a public API for looking at registered or enqueued scripts, but you can look inside the object and see what’s going on. You can see all the registered scripts with: global $wp_scripts; var_dump( $wp_scripts->registered ); To see the … Read more

wp_register_script multiple identifiers?

To have the JavaScript Libraries not to load since you already created a bundle of them, do the following: Asumming the following, usual enqueue: function the_js() { wp_enqueue_script(‘bundle_js’, get_template_directory_uri() . ‘/js/bundle.js’, array(), false, false); } add_action(‘wp_enqueue_scripts’, ‘the_js’); and lets say you have in your bundle the following libraries (listing the handles): jquery backbone colorpicker bootstrap_js … Read more

Setting up an API “listening” page

I would use the Rewrite API and the template_redirect action to respond to API requests. As an example, if I wanted to respond to requests directed to the url: example.com/example-path/ with logic in my theme or plugin’s endpoint.php file I would create a rewrite rule and template redirect hook like so: add_action( ‘init’, ‘example_rewrite_rules’ ); … Read more

Odd Script File Trying to be Loaded

In Network Admin > Settings > Domain Mapping > Domain Options, uncheck Remote Login. That should also remove it. In my case, the “script” just retrieves the home page (html), causing a script error and a lot of wasted resources on every page view. Similar complaints in Does Domain Mapping plugin insert javascript on headers?.