From d39d60e841176186505716d22982bee2d61dc719 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 27 Jan 2014 16:32:12 +0000 Subject: [PATCH] Add wp_install and wp_upgrade hooks to the respective functions. props Denis-de-Bernardy. fixes #25762. Built from https://develop.svn.wordpress.org/trunk@27045 git-svn-id: http://core.svn.wordpress.org/trunk@26919 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 1622cab934..5d2e3fc198 100644 --- a/wp-admin/includes/upgrade.php +++ b/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;