do_action( "wpcd_server_{$this->get_app_name()}_server_created", $attributes )
Example Hook #
add_action( "wpcd_server_wordpress-app_server_created", 'my_function', 10, 1 ); public function my_function( $attributes ) { //your code here }
Discussion #
This hook is triggered after a server has been created but before we install our software stack on it. At this point the only software on the server is the Operating System.
$attributes is an array that contains information about the server. But this data (and sometimes more) is also present on the server record which can be accessed using the post_id in the array – $attributes[‘post_id’].
If you attempt to connect to the server when this hook fires, there is no guarantee that the server is fully up and running. So you should include “retry” logic in your code to retry the server connection until the server is up and running.
Reference #
Located in:
- Function: do_instance_action
- File: /includes/core/apps/wordpress-app/traits/traits-for-class-wordpress-app/commands-and-logs.php
Availability #
This hook is only available in DVI versions 4.2.5 or later.
More Topics In Dev Notes #
- Filter Hook: wpcd_script_file_contents
- Filter Hook: wpcd_wpapp_show_install_wp_button
- Filter Hook: wpcd_wpapp_show_install_wp_link
- Filter Hook: wpcd_settings_help_tab_text
- Filter Hook: wpcd_settings_welcome_text_initial
- Filter Hook: wpcd_settings_welcome_text
- Filter Hook: wpcd_settings_deploy_first_wp_site_text
- Custom Post Types Used By DVI
- Action Hook: wpcd_server_wordpress-app_prepare_server_command_done
- Action Hook: wpcd_command_wordpress-app_completed
- Action Hook: wpcd_command_wordpress-app_prepare_server_completed
- Filter Hook: wpcd_wordpress-app_initial_server_attributes
- Filter Hook: wpcd_wordpress-app_create_popup
- Filter Hook: wpcd_wordpress-app_install_app_popup
- Filter Hook: wpcd_wordpress-app_initial_server_attributes_wc
- Filter Hook: wpcd_wordpress-app_install_wp_app_parms
- Action Hook: wpcd_command_wordpress-app_completed_after_cleanup
- Site Update Plans: Pending Task Sequence Technical Note