Trigger a php file on every post or page if a condition is met
Trigger a php file on every post or page if a condition is met
Trigger a php file on every post or page if a condition is met
Use wp_enqueue_script in your shortcode handler, in WordPress >= 3.3 it will be added to the page in the wp_footer action. Pass any data you need from PHP to JavaScript via wp_localize_script.
Having the “shortest” script is a fairly pointless goal here I think, besides for entertainment purposes. But if you are looking for something that is very minimal and easy to understand, you can check out Bash scripts like my own free SlickStack project on GitHub, which is geared toward LEMP stack newbies. Keep mind that … Read more
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
This may be what you’re looking for http://wordpress.org/extend/plugins/suicide/. As a super admin you can select which sites you would like to remove the content from within your multisite setup.
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
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
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
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?.
If you refer to this script, this is not included in wordpress. See the codex for list of scripts included in wp you will not find it. If you don’t trust codex, you can look into the folder wp-includes/js and search for easing script… it’s not there. Edit (additional info) Answer above just ‘strictly’ respond … Read more