Make WordPress Core


Ignore:
Timestamp:
06/30/2021 05:43:29 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Remove redundant type casting to array in WP_Query::get_posts().

This brings some consistency with other instances of using get_post_stati() in core.

get_post_stati() always returns an array, so the type casting is not needed.

Follow-up to [13172].

See #53359.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r51121 r51285  
    18731873        $private_states = get_post_stati( array( 'private' => true ) );
    18741874        $where         .= " AND ( p.post_status = 'publish'";
    1875         foreach ( (array) $private_states as $state ) {
     1875        foreach ( $private_states as $state ) {
    18761876            if ( current_user_can( $read_private_cap ) ) {
    18771877                $where .= $wpdb->prepare( ' OR p.post_status = %s', $state );
Note: See TracChangeset for help on using the changeset viewer.