Changeset 15452 for branches/3.0/wp-admin/includes/ms.php
- Timestamp:
- 07/21/2010 08:10:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-admin/includes/ms.php
r15382 r15452 179 179 180 180 function confirm_delete_users( $users ) { 181 global $current_user;181 $current_user = wp_get_current_user(); 182 182 if ( !is_array( $users ) ) 183 183 return false; 184 184 185 186 185 screen_icon(); 186 ?> 187 187 <h2><?php esc_html_e( 'Users' ); ?></h2> 188 188 <p><?php _e( 'Transfer or delete posts and links before deleting users.' ); ?></p> 189 189 <form action="ms-edit.php?action=dodelete" method="post"> 190 190 <input type="hidden" name="dodelete" /> 191 191 <?php 192 192 wp_nonce_field( 'ms-users-delete' ); 193 193 $site_admins = get_super_admins(); … … 312 312 313 313 function send_confirmation_on_profile_email() { 314 global $errors, $wpdb, $current_user; 314 global $errors, $wpdb; 315 $current_user = wp_get_current_user(); 315 316 if ( ! is_object($errors) ) 316 317 $errors = new WP_Error(); … … 365 366 366 367 function new_user_email_admin_notice() { 367 global $current_user; 368 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( $current_user->ID . '_new_email' ) ) 368 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) ) 369 369 echo "<div class='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "</div>"; 370 370 } … … 599 599 600 600 function redirect_user_to_blog() { 601 global $current_user;602 601 $c = 0; 603 602 if ( isset( $_GET['c'] ) ) … … 609 608 $c ++; 610 609 611 $blog = get_active_blog_for_user( $current_user->ID);610 $blog = get_active_blog_for_user( get_current_user_id() ); 612 611 $dashboard_blog = get_dashboard_blog(); 613 612 if ( is_object( $blog ) ) { … … 620 619 then update the primary_blog record to match the user's blog 621 620 */ 622 $blogs = get_blogs_of_user( $current_user->ID);621 $blogs = get_blogs_of_user( get_current_user_id() ); 623 622 624 623 if ( !empty( $blogs ) ) { 625 624 foreach( $blogs as $blogid => $blog ) { 626 if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID, 'primary_blog', true ) == $dashboard_blog->blog_id ) {627 update_user_meta( $current_user->ID, 'primary_blog', $blogid );625 if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) { 626 update_user_meta( get_current_user_id(), 'primary_blog', $blogid ); 628 627 continue; 629 628 } 630 629 } 631 $blog = get_blog_details( get_user_meta( $current_user->ID, 'primary_blog', true ) );630 $blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) ); 632 631 wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); 633 632 exit; … … 698 697 699 698 function admin_notice_feed() { 700 global $current_ user, $current_screen;699 global $current_screen; 701 700 if ( $current_screen->id != 'dashboard' ) 702 701 return; 703 702 704 703 if ( !empty( $_GET['feed_dismiss'] ) ) { 705 update_user_option( $current_user->id, 'admin_feed_dismiss', $_GET['feed_dismiss'], true );704 update_user_option( get_current_user_id(), 'admin_feed_dismiss', $_GET['feed_dismiss'], true ); 706 705 return; 707 706 } … … 729 728 730 729 function site_admin_notice() { 731 global $ current_user, $wp_db_version;730 global $wp_db_version; 732 731 if ( !is_super_admin() ) 733 732 return false; … … 761 760 762 761 function choose_primary_blog() { 763 global $current_user;764 762 ?> 765 763 <table class="form-table"> … … 769 767 <td> 770 768 <?php 771 $all_blogs = get_blogs_of_user( $current_user->ID);772 $primary_blog = get_user_meta( $current_user->ID, 'primary_blog', true );769 $all_blogs = get_blogs_of_user( get_current_user_id() ); 770 $primary_blog = get_user_meta( get_current_user_id(), 'primary_blog', true ); 773 771 if ( count( $all_blogs ) > 1 ) { 774 772 $found = false; … … 784 782 if ( !$found ) { 785 783 $blog = array_shift( $all_blogs ); 786 update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );784 update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); 787 785 } 788 786 } elseif ( count( $all_blogs ) == 1 ) { … … 790 788 echo $blog->domain; 791 789 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. 792 update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id );790 update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); 793 791 } else { 794 792 echo "N/A";
Note: See TracChangeset
for help on using the changeset viewer.