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-includes/post.php

    r31789 r31829  
    46004600
    46014601    if ( 1 == count( $post_status ) ) {
    4602         $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], array_shift( $post_status ) );
     4602        $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], reset( $post_status ) );
    46034603    } else {
    46044604        $post_status = implode( "', '", $post_status );
Note: See TracChangeset for help on using the changeset viewer.