mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Replace array_shift() with reset() where appropriate for performance.
Props SergeyBiryukov. Fixes #31259. git-svn-id: https://develop.svn.wordpress.org/trunk@31829 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -804,11 +804,11 @@ function choose_primary_blog() {
|
||||
</select>
|
||||
<?php
|
||||
if ( !$found ) {
|
||||
$blog = array_shift( $all_blogs );
|
||||
$blog = reset( $all_blogs );
|
||||
update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
|
||||
}
|
||||
} elseif ( count( $all_blogs ) == 1 ) {
|
||||
$blog = array_shift( $all_blogs );
|
||||
$blog = reset( $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_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
|
||||
|
||||
Reference in New Issue
Block a user