Make WordPress Core


Ignore:
Timestamp:
05/10/2024 06:07:17 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Use a consistent plural form of “status” in variable names.

Follow-up to [5575], [6796], [6993], [7638], [12162], [12719], [15578], [16652], [31046], [34515], [49472].

Props Presskopp, sabernhardt, manfcarlo, SergeyBiryukov.
Fixes #58134.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r57860 r58129  
    12001200 */
    12011201function get_available_post_statuses( $type = 'post' ) {
    1202         $stati = wp_count_posts( $type );
    1203 
    1204         return array_keys( get_object_vars( $stati ) );
     1202        $statuses = wp_count_posts( $type );
     1203
     1204        return array_keys( get_object_vars( $statuses ) );
    12051205}
    12061206
     
    12181218                $q = $_GET;
    12191219        }
    1220         $q['m']     = isset( $q['m'] ) ? (int) $q['m'] : 0;
    1221         $q['cat']   = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
    1222         $post_stati = get_post_stati();
     1220
     1221        $q['m']   = isset( $q['m'] ) ? (int) $q['m'] : 0;
     1222        $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
     1223
     1224        $post_statuses = get_post_stati();
    12231225
    12241226        if ( isset( $q['post_type'] ) && in_array( $q['post_type'], get_post_types(), true ) ) {
     
    12321234        $perm             = '';
    12331235
    1234         if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati, true ) ) {
     1236        if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_statuses, true ) ) {
    12351237                $post_status = $q['post_status'];
    12361238                $perm        = 'readable';
Note: See TracChangeset for help on using the changeset viewer.