From af7a7cfa08e62441e0d0fce4a78b2cc8f1e26b3d Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Wed, 19 Apr 2023 18:18:09 +0530 Subject: [PATCH] run the post install callback earlier --- includes/Services/PluginInstaller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(