From bd9729c22d200a1962f80a8c642656d90d9148fe Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 27 Jan 2014 16:31:54 +0000 Subject: [PATCH] Add wp_install and wp_upgrade hooks to the respective functions. props Denis-de-Bernardy. fixes #25762. git-svn-id: https://develop.svn.wordpress.org/trunk@27045 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 1622cab934..5d2e3fc198 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -86,6 +86,15 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated wp_cache_flush(); + /** + * Fires after a site is fully installed. + * + * @since 3.9.0 + * + * @param WP_User $user The site owner. + */ + do_action( 'wp_install', $user ); + return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); } endif; @@ -317,6 +326,16 @@ function wp_upgrade() { else $wpdb->query( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" ); } + + /** + * Fires after a site is fully upgraded. + * + * @since 3.9.0 + * + * @param int $new_db_version The new $wp_db_version. + * @param int $old_db_version The old $wp_db_version. + */ + do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version ); } endif;