Make WordPress Core

Changeset 55334


Ignore:
Timestamp:
02/14/2023 03:44:41 PM (12 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the remaining $cat_ID variables to $cat_id.

This resolves a few WPCS warnings:

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

Affected functions:

  • wp_delete_category()
  • get_category_rss_link()
  • get_catname()

Follow-up to [836], [2068], [2551], [2695], [6365], [10959], [52958], [55190].

Fixes #56754.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r55308 r55334  
    11511151 *
    11521152 * @param bool $display
    1153  * @param int $cat_ID
     1153 * @param int $cat_id
    11541154 * @return string
    11551155 */
    1156 function get_category_rss_link($display = false, $cat_ID = 1) {
     1156function get_category_rss_link($display = false, $cat_id = 1) {
    11571157    _deprecated_function( __FUNCTION__, '2.5.0', 'get_category_feed_link()' );
    11581158
    1159     $link = get_category_feed_link($cat_ID, 'rss2');
     1159    $link = get_category_feed_link($cat_id, 'rss2');
    11601160
    11611161    if ( $display )
     
    12491249 * @see get_cat_name()
    12501250 *
    1251  * @param int $cat_ID Category ID
     1251 * @param int $cat_id Category ID
    12521252 * @return string category name
    12531253 */
    1254 function get_catname( $cat_ID ) {
     1254function get_catname( $cat_id ) {
    12551255    _deprecated_function( __FUNCTION__, '2.8.0', 'get_cat_name()' );
    1256     return get_cat_name( $cat_ID );
     1256    return get_cat_name( $cat_id );
    12571257}
    12581258
  • trunk/src/wp-includes/taxonomy.php

    r55018 r55334  
    21552155 * @since 2.0.0
    21562156 *
    2157  * @param int $cat_ID Category term ID.
     2157 * @param int $cat_id Category term ID.
    21582158 * @return bool|int|WP_Error Returns true if completes delete action; false if term doesn't exist;
    21592159 *                           Zero on attempted deletion of default Category; WP_Error object is
    21602160 *                           also a possibility.
    21612161 */
    2162 function wp_delete_category( $cat_ID ) {
    2163     return wp_delete_term( $cat_ID, 'category' );
     2162function wp_delete_category( $cat_id ) {
     2163    return wp_delete_term( $cat_id, 'category' );
    21642164}
    21652165
Note: See TracChangeset for help on using the changeset viewer.