do_action( "wpcd_command_{$this->get_app_name()}_{$status}", $id, $name,$base_command )
This is a variable action hook whose name changes based on the status of the command being run. See discussion below for more information.
add_action( "wpcd_command_wordpress-app_completed", 'my_function', 10, 3 ); public function my_function( $id, $name,$base_command ) { //your code here }
This hook is fired after any long-running command is completed. Long running commands are actions like deploying servers and websites (the ones that usually include the black ‘terminal’ screen.)
The name of the hook depends on the status and the app name being run. For WordPress actions, the app name will always be wordpress-app. The most common status you use will be completed.
Unless you want to run an action after every single long-running command, you should check the $name variable and base your code on the result of that check.
If you are looking to run actions after a server is deployed you can use this hook. This is NOT the hook to use if you need to run actions after a WordPress site has been deployed. For that you should use the wpcd_command_wordpress-app_completed_after_cleanup hook instead.
Located in:
This hook is only available in WPCD versions 4.2.5 or later.