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
This commit is contained in:
parent
ad9f1f3258
commit
bd9729c22d
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user