Make WordPress Core


Ignore:
Timestamp:
07/20/2022 02:12:02 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Standardize on user_id when passing data to comment functions.

The wp_new_comment(), wp_update_comment(), and wp_filter_comment() functions already normalize the user_ID parameter internally to user_id, which matches the database field name.

This commit aims to bring some consistency when passing the parameter in core.

The corresponding $user_ID variable is also renamed to $user_id to match the other variables when not referring to the $user_ID global, which has an exception in the WordPress coding standards.

Follow-up to [8543], [8720], [12267], [12300], [26491], [28915], [28922], [34799], [49303].

See #55647, #56244.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r53723 r53729  
    39513951            $comment['comment_author_email'] = $this->escape( $user_email );
    39523952            $comment['comment_author_url']   = $this->escape( $user_url );
    3953             $comment['user_ID']              = $user->ID;
     3953            $comment['user_id']              = $user->ID;
    39543954        } else {
    39553955            $comment['comment_author'] = '';
     
    39683968            }
    39693969
    3970             $comment['user_ID'] = 0;
     3970            $comment['user_id'] = 0;
    39713971
    39723972            if ( get_option( 'require_name_email' ) ) {
Note: See TracChangeset for help on using the changeset viewer.