Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Is there another way for me to run a WP-CLI command from within a PHP script other than using the shell_exec() function.
If it's a script you created, then move the function outside of WP CLI, where both WP CLI and your PHP script can access, and then have your WP CLI command run that function.
Required, but never shown