I have a php script that sits outside of wordpress, but loads WP core with wp-load.php.
Here is my basic page:
<?php
define('WP_USE_THEMES', false);
global $wp, $wp_query, $wp_the_query, $wp_did_header;
require_once('wp-load.php');
switch_to_blog(1); //make sure we're on the top level site
$author_id = 77; //admin
?>
However, this also loads plugins - one of which (FacetWP) is throwing an error. As I don't need it, I thought I'd deactivate it with:
function deactivate_plugin_conditional() {
deactivate_plugins('facetwp/index.php');
}
add_action( 'admin_init', 'deactivate_plugin_conditional' );
However, this didn't appear to work, so I thought I'd try a simple echo:
function myDebug() {
echo "test";
}
add_action( 'init', 'myDebug', 10, 1 );
This didn't work either, so I'm clearly not understanding how to use these API calls. Any help with this problem would be much appreciated.