This client wants to automatically activate a wordpress plugin every Tuesday between some hours. This is because the plugin has conflicts with another plugin. I did not find anything on the net about that, how to do it… anyone knows what happens behind wordpress when the button activate plugin is clicked? I can’t find that specific page in my wordpress folder…
Thanks!
Something that I tried and not working:
require('/web/htdocs/www.fattorefamiglia.com/home/wp-content/plugins/quick-chat/quick-chat.php');
function toggle_plugin() {
// Full path to WordPress from the root
$wordpress_path = '/web/htdocs/www.fattorefamiglia.com/home/';
// Absolute path to plugins dir
$plugin_path = $wordpress_path.'wp-content/plugins/';
// Absolute path to your specific plugin
$my_plugin = $plugin_path.'quick-chat/quick-chat.php';
$start = strtotime('1:30');
$end = strtotime('22:30');
$timenow = date('U');
if((date('w') == 3) && ($timenow >= $start && $timenow <= $end)) { // day 2 = Tuesday
activate_plugin($my_plugin);
}
else {
deactivate_plugins($my_plugin);
}
}
I put this code in functions.php
1 comment