Make WordPress Core


Ignore:
Timestamp:
03/19/2015 03:55:39 AM (10 years ago)
Author:
wonderboymusic
Message:

Replace array_shift() with reset() where appropriate for performance.

Props SergeyBiryukov.
Fixes #31259.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r31516 r31829  
    316316// Compare user role against currently editable roles
    317317$user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );
    318 $user_role  = array_shift( $user_roles );
     318$user_role  = reset( $user_roles );
    319319
    320320// print the full list of roles with the primary one selected.
Note: See TracChangeset for help on using the changeset viewer.