diff --git a/includes/Services/PluginInstaller.php b/includes/Services/PluginInstaller.php index 86423afd1..89d2eb497 100644 --- a/includes/Services/PluginInstaller.php +++ b/includes/Services/PluginInstaller.php @@ -88,6 +88,9 @@ public static function install( $plugin, $activate ) { if ( \is_wp_error( $status ) ) { return $status; } + if ( is_callable( $plugin_post_install_callback ) ) { + $plugin_post_install_callback(); + } } if ( $activate && ! \is_plugin_active( $plugin_path ) ) { @@ -97,9 +100,6 @@ public static function install( $plugin, $activate ) { return $status; } - if ( is_callable( $plugin_post_install_callback ) ) { - $plugin_post_install_callback(); - } } return new \WP_REST_Response(