To call hook on a php external file
To call hook on a php external file
To call hook on a php external file
The code requiring wp-load is within a theme template (not a plugin). Specifically, within a page-template that allows a custom post to be added/edited from the frontend. A page template should not require any explicit loading of the WordPress Core. The template itself wouldn’t load if WordPress were not already loaded. Your other errors are … Read more
Why I obtain a white page when I import a backup of an old WP blog on my local web server? [duplicate]
Get wp-load.php PATH with wp_localize_script and JavaScript for plugin
It’s catch 22 – you need WordPress to use the hook system, but init will have already fired during load (wp-settings.php to be exact). I would create a MU “Must Use” plugin (wp-content/mu-plugins/any-filename.php) for all your “outside of WordPress” functionality, with something like this at the start: if ( ! defined( ‘LOADED_EXTERNAL’ ) || ! … Read more
No caching plugin will cache ajax request because it is considered a bad idea to cache a post request as they are usually used to change the state of the site and therefor might have a different response. You will have to write such a caching by yourself.
What is the best practice to initialise $wpdb by loading wp-load.php?
If anyone is wondering I figured it out. Since I was hosting my WordPress site on a Chassis server, the path I needed to use in my require statement was different than the actual path on my machine.
Write a bash script (or any other shell script) to loop ocer the site and in php just write the detection for a single site and output the value to standard output or a file. Or use http://wp-cli.org/ (which essentially does for you the php code from the paragraph above).
Exploiting WordPress Core Functionality for Development