[wp-trac] [WordPress Trac] #56244: Use a consistent parameter name for functions accepting a comment ID or object

WordPress Trac noreply at wordpress.org
Sat Jul 23 16:32:50 UTC 2022


#56244: Use a consistent parameter name for functions accepting a comment ID or
object
----------------------------+-------------------------------------
 Reporter:  SergeyBiryukov  |       Owner:  SergeyBiryukov
     Type:  enhancement     |      Status:  accepted
 Priority:  normal          |   Milestone:  6.1
Component:  Comments        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  docs, coding-standards
----------------------------+-------------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:18 peterwilsoncc]:
 > Re: my comment yesterday
 >
 > > With the patch applied `isset( $commentdata['user_ID'] )` will always
 return `true` after the filter...
 >
 > It occurred to me overnight that I was wrong. If a plugin reconstructs
 the array in it's entirety using `user_id` then this will be false.

 Thinking about this some more, it might be beneficial for the
 `comment_post` action to also consistently receive both `user_id` and
 `user_ID`, as does the `preprocess_comment` filter.

 [attachment:"56244.3.diff"] implements that, bringing consistency between
 the two normalization fragments. A similar approach could then be used for
 other fields with mixed case names in #56261.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56244#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list