[wp-trac] [WordPress Trac] #56244: Use a consistent parameter name for functions accepting a comment ID or object
WordPress Trac
noreply at wordpress.org
Wed Jul 20 14:14:56 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:5 peterwilsoncc]:
> Something I hit working on a plugin is that sometimes `$comment_ID` is
subsequently used in a `compact()` for functions taking an array of
arguments.
>
> This makes the case of the ID important for backward compatibility.
Thanks! Yes, the intention here is to fully maintain backward
compatibility.
I've been thinking about opening another ticket for normalizing other
parameters in the same way as it was done for `user_ID` → `user_id` in
[12267], [12300], and [28915]:
* `comment_ID` → `comment_id`
* `comment_post_ID` → `comment_post_id`
* `comment_author_IP` → `comment_author_ip`
Then any combination of these parameters would work regardless of the
case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56244#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list