mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Multisite: Replace get_blog_details()
in add_user_to_blog()
with get_site()
.
Adds tests for `add_user_to_blog()`. Props flixos90. Fixes #38356. Built from https://develop.svn.wordpress.org/trunk@38903 git-svn-id: http://core.svn.wordpress.org/trunk@38846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
749b480de0
commit
390dc4b345
@ -161,8 +161,8 @@ function add_user_to_blog( $blog_id, $user_id, $role ) {
|
|||||||
|
|
||||||
if ( !get_user_meta($user_id, 'primary_blog', true) ) {
|
if ( !get_user_meta($user_id, 'primary_blog', true) ) {
|
||||||
update_user_meta($user_id, 'primary_blog', $blog_id);
|
update_user_meta($user_id, 'primary_blog', $blog_id);
|
||||||
$details = get_blog_details($blog_id);
|
$site = get_site( $blog_id );
|
||||||
update_user_meta($user_id, 'source_domain', $details->domain);
|
update_user_meta( $user_id, 'source_domain', $site->domain );
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->set_role($role);
|
$user->set_role($role);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38902';
|
$wp_version = '4.7-alpha-38903';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user