mirror of
https://gh.wpcy.net/https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2026-04-24 05:09:10 +08:00
29 lines
755 B
PHP
29 lines
755 B
PHP
<?php
|
|
|
|
/*
|
|
* Plugin Name: Disable HelloPack on frontend
|
|
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
|
|
*/
|
|
|
|
add_filter(
|
|
'option_active_plugins',
|
|
static function ($plugins) {
|
|
if (
|
|
(defined('WP_CLI') && WP_CLI)
|
|
|| (defined('DOING_CRON') && DOING_CRON)
|
|
|| is_admin()
|
|
|| (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)
|
|
|| (defined('REST_REQUEST') && REST_REQUEST)
|
|
) {
|
|
return $plugins;
|
|
}
|
|
|
|
if (in_array('hellopack-client/hellopack-client.php', $plugins, true)) {
|
|
$plugins = array_values(array_diff($plugins, ['hellopack-client/hellopack-client.php']));
|
|
}
|
|
|
|
return $plugins;
|
|
},
|
|
1,
|
|
1
|
|
);
|