Make WordPress Core

Changeset 55190


Ignore:
Timestamp:
02/02/2023 01:57:48 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $cat_ID variable to $cat_id in wp_update_category().

This resolves a few WPCS warnings:

Variable "$cat_ID" is not in valid snake_case format, try "$cat_i_d"

Follow-up to [2695], [4490], [52958].

Props hilayt24, viralsampat, desrosj, robinwpdeveloper, tanazmasaba, costdev, SergeyBiryukov.
See #56754.

File:
1 edited

Legend:

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

    r53516 r55190  
    187187 */
    188188function wp_update_category( $catarr ) {
    189     $cat_ID = (int) $catarr['cat_ID'];
    190 
    191     if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) {
     189    $cat_id = (int) $catarr['cat_ID'];
     190
     191    if ( isset( $catarr['category_parent'] ) && ( $cat_id == $catarr['category_parent'] ) ) {
    192192        return false;
    193193    }
    194194
    195195    // First, get all of the original fields.
    196     $category = get_term( $cat_ID, 'category', ARRAY_A );
     196    $category = get_term( $cat_id, 'category', ARRAY_A );
    197197    _make_cat_compat( $category );
    198198
Note: See TracChangeset for help on using the changeset viewer.