Don't use deprecated *_usermeta() functions. Props technosailor fixes #10837

git-svn-id: https://develop.svn.wordpress.org/trunk@13311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-02-22 21:25:32 +00:00
parent b1ee08dcbe
commit 670b8d8bfb
14 changed files with 72 additions and 72 deletions

View File

@@ -543,12 +543,12 @@ function redirect_user_to_blog() {
if ( !empty( $blogs ) ) {
foreach( $blogs as $blogid => $blog ) {
if ( $blogid != $dashboard_blog->blog_id && get_usermeta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {
update_usermeta( $current_user->ID, 'primary_blog', $blogid );
if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {
update_user_meta( $current_user->ID, 'primary_blog', $blogid );
continue;
}
}
$blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) );
$blog = get_blog_details( get_user_meta( $current_user->ID , 'primary_blog' ) );
$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_usermeta($current_user->ID, 'primary_blog');
$primary_blog = get_user_meta($current_user->ID, 'primary_blog');
if ( count( $all_blogs ) > 1 ) {
$found = false;
?>
@@ -704,13 +704,13 @@ function choose_primary_blog() {
<?php
if ( !$found ) {
$blog = array_shift( $all_blogs );
update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );
}
} elseif ( count( $all_blogs ) == 1 ) {
$blog = array_shift( $all_blogs );
echo $blog->domain;
if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );
} else {
echo "N/A";
}