Switch over to *_user_meta() syntax. The old get_usermeta() would return a string when only one value was found, get_user_meta() requires $single = true. Fixes #10837
git-svn-id: http://svn.automattic.com/wordpress/trunk@13329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6050c6992
commit
4e56d1c6a9
|
@ -543,12 +543,12 @@ function redirect_user_to_blog() {
|
|||
|
||||
if ( !empty( $blogs ) ) {
|
||||
foreach( $blogs as $blogid => $blog ) {
|
||||
if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {
|
||||
if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog', true ) == $dashboard_blog->blog_id ) {
|
||||
update_user_meta( $current_user->ID, 'primary_blog', $blogid );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$blog = get_blog_details( get_user_meta( $current_user->ID , 'primary_blog' ) );
|
||||
$blog = get_blog_details( get_user_meta( $current_user->ID, 'primary_blog', true ) );
|
||||
$protocol = ( is_ssl() ? 'https://' : 'http://' );
|
||||
wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
|
||||
exit;
|
||||
|
@ -690,7 +690,7 @@ function choose_primary_blog() {
|
|||
<td>
|
||||
<?php
|
||||
$all_blogs = get_blogs_of_user( $current_user->ID );
|
||||
$primary_blog = get_user_meta($current_user->ID, 'primary_blog');
|
||||
$primary_blog = get_user_meta($current_user->ID, 'primary_blog', true);
|
||||
if ( count( $all_blogs ) > 1 ) {
|
||||
$found = false;
|
||||
?>
|
||||
|
|
|
@ -704,7 +704,7 @@ function upgrade_160() {
|
|||
// FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.
|
||||
$caps = get_user_meta( $user->ID, $wpdb->prefix . 'capabilities');
|
||||
if ( empty($caps) || defined('RESET_CAPS') ) {
|
||||
$level = get_user_meta($user->ID, $wpdb->prefix . 'user_level');
|
||||
$level = get_user_meta($user->ID, $wpdb->prefix . 'user_level', true);
|
||||
$role = translate_level_to_role($level);
|
||||
update_user_meta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) );
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ function get_active_blog_for_user( $user_id ) { // get an active blog for user -
|
|||
return $details;
|
||||
}
|
||||
|
||||
$primary_blog = get_user_meta( $user_id, "primary_blog" );
|
||||
$primary_blog = get_user_meta( $user_id, 'primary_blog', true );
|
||||
$details = get_dashboard_blog();
|
||||
if ( $primary_blog ) {
|
||||
$blogs = get_blogs_of_user( $user_id );
|
||||
|
@ -109,11 +109,11 @@ function get_active_blog_for_user( $user_id ) { // get an active blog for user -
|
|||
if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
|
||||
$ret = $blog;
|
||||
$changed = false;
|
||||
if ( get_user_meta( $user_id , 'primary_blog' ) != $blog_id ) {
|
||||
if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id ) {
|
||||
update_user_meta( $user_id, 'primary_blog', $blog_id );
|
||||
$changed = true;
|
||||
}
|
||||
if ( !get_user_meta($user_id , 'source_domain') ) {
|
||||
if ( !get_user_meta($user_id , 'source_domain', true) ) {
|
||||
update_user_meta( $user_id, 'source_domain', $blog->domain );
|
||||
$changed = true;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ function add_user_to_blog( $blog_id, $user_id, $role ) {
|
|||
if ( empty($user) )
|
||||
return new WP_Error('user_does_not_exist', __('That user does not exist.'));
|
||||
|
||||
if ( !get_user_meta($user_id, 'primary_blog') ) {
|
||||
if ( !get_user_meta($user_id, 'primary_blog', true) ) {
|
||||
update_user_meta($user_id, 'primary_blog', $blog_id);
|
||||
$details = get_blog_details($blog_id);
|
||||
update_user_meta($user_id, 'source_domain', $details->domain);
|
||||
|
@ -270,7 +270,7 @@ function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
|
|||
|
||||
// If being removed from the primary blog, set a new primary if the user is assigned
|
||||
// to multiple blogs.
|
||||
$primary_blog = get_user_meta($user_id, 'primary_blog');
|
||||
$primary_blog = get_user_meta($user_id, 'primary_blog', true);
|
||||
if ( $primary_blog == $blog_id ) {
|
||||
$new_id = '';
|
||||
$new_domain = '';
|
||||
|
@ -826,7 +826,7 @@ function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id
|
|||
add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
|
||||
update_option( 'blog_public', $meta['public'] );
|
||||
|
||||
if ( !is_super_admin() && get_user_meta( $user_id, 'primary_blog' ) == get_site_option( 'dashboard_blog', 1 ) )
|
||||
if ( !is_super_admin() && get_user_meta( $user_id, 'primary_blog', true ) == get_site_option( 'dashboard_blog', 1 ) )
|
||||
update_user_meta( $user_id, 'primary_blog', $blog_id );
|
||||
|
||||
restore_current_blog();
|
||||
|
|
Loading…
Reference in New Issue