From 9d25b5df112a8a55f7de21773fcf44f9bff0fee4 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Thu, 7 Sep 2017 16:06:55 -0700
Subject: [PATCH] Whitelist WP-CLI's native commands

---
 includes/functions.php | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/includes/functions.php b/includes/functions.php
index 0e9e3c7..0518382 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -18,11 +18,37 @@ function is_subcommand_allowed( $subcommand ) {
  * @return array
  */
 function get_subcommand_whitelist() {
-	return array();
+	// Supported built-in commands
+	$whitelist = array(
+		'cache',
+		'cap',
+		'comment',
+		'import',
+		'media',
+		'menu',
+		'network',
+		'option',
+		'plugin',
+		'post',
+		'post-type',
+		'rewrite',
+		'role',
+		'sidebar',
+		'site',
+		'super-admin',
+		'taxonomy',
+		'term',
+		'theme',
+		'transient',
+		'user',
+		'widget',
+	);
+
+	return apply_filters( 'wp_cli_cron_control_offload_subcommand_whitelist', $whitelist );
 }
 
 /**
- * Certain commands should never be supported
+ * Certain commands should never be allowed
  *
  * @return array
  */
@@ -35,6 +61,7 @@ function get_subcommand_blacklist() {
 		'db',
 		'eval',
 		'eval-file',
+		'package',
 		'scaffold',
 		'server',
 	);
-- 
GitLab