Make WordPress Core


Ignore:
Timestamp:
02/22/2010 09:25:32 PM (17 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r13301 r13311  
    544544        if ( !empty( $blogs ) ) {
    545545                foreach( $blogs as $blogid => $blog ) {
    546                         if ( $blogid != $dashboard_blog->blog_id && get_usermeta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {
    547                                 update_usermeta( $current_user->ID, 'primary_blog', $blogid );
     546                        if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {
     547                                update_user_meta( $current_user->ID, 'primary_blog', $blogid );
    548548                                continue;
    549549                        }
    550550                }
    551                 $blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) );
     551                $blog = get_blog_details( get_user_meta( $current_user->ID , 'primary_blog' ) );
    552552                $protocol = ( is_ssl() ? 'https://' : 'http://' );
    553553                wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
     
    691691                <?php
    692692                $all_blogs = get_blogs_of_user( $current_user->ID );
    693                 $primary_blog = get_usermeta($current_user->ID, 'primary_blog');
     693                $primary_blog = get_user_meta($current_user->ID, 'primary_blog');
    694694                if ( count( $all_blogs ) > 1 ) {
    695695                        $found = false;
     
    705705                        if ( !$found ) {
    706706                                $blog = array_shift( $all_blogs );
    707                                 update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
     707                                update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );
    708708                        }
    709709                } elseif ( count( $all_blogs ) == 1 ) {
     
    711711                        echo $blog->domain;
    712712                        if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
    713                                 update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
     713                                update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );
    714714                } else {
    715715                        echo "N/A";
Note: See TracChangeset for help on using the changeset viewer.