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
This commit is contained in:
parent
544116e76a
commit
d39d60e841
|
@ -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