From 48aaba062e6b9a0976918dfc9c77132d6b1413b3 Mon Sep 17 00:00:00 2001 From: Iain MacDonald Date: Wed, 8 Nov 2023 10:55:22 +0800 Subject: [PATCH] Fix wp-cli bug call_user_func(): Argument #1 ($callback) must be a valid callback --- qtranslate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtranslate.php b/qtranslate.php index 36da25c3..d80eb3ef 100644 --- a/qtranslate.php +++ b/qtranslate.php @@ -65,7 +65,7 @@ require_once QTRANSLATE_DIR . '/src/init.php'; add_action( 'plugins_loaded', 'qtranxf_init_language', 2 ); // User is not authenticated yet, high priority needed. -if ( is_admin() ) { +if ( is_admin() || defined( 'WP_CLI' ) ) { require_once QTRANSLATE_DIR . '/src/admin/activation_hook.php'; qtranxf_register_activation_hooks(); }