WP CLI – show users whose ID is larger than given ID
One way to work with existing WP-CLI commands is through the WP_CLI::runcommand(). Here are two examples how we can filter an existing WP-CLI command, namely the wp user list command based on WP_User_Query and it’s pre_user_query hook: Run a custom script in WP-CLI Let’s write our script.php file with: <?php add_action( ‘pre_user_query’, ‘wpse_pre_user_query’ ); WP_CLI::runcommand( … Read more