[wp-trac] [WordPress Trac] #56261: Normalize comment function parameters with mixed case names
WordPress Trac
noreply at wordpress.org
Wed Jul 20 16:34:47 UTC 2022
#56261: Normalize comment function parameters with mixed case names
----------------------------+-------------------------------------
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 [ticket:56261 SergeyBiryukov]:
> This would allow extenders to name variables in accordance with the
WordPress coding standards:
> * `$comment_id`
> * `$comment_post_id`
> * `$comment_author_ip`
> and use them subsequently in a `compact()` call without having to worry
about a case mismatch.
To clarify a bit, this aims to fix WPCS issues like this:
{{{
| WARNING | [ ] Variable "$comment_ID" is not in valid snake_case
| | format, try "$comment_i_d"
| |
(WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase)
| WARNING | [ ] Variable "$comment_post_ID" is not in valid snake_case
| | format, try "$comment_post_i_d"
| |
(WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase)
| WARNING | [ ] Variable "$comment_author_IP" is not in valid snake_case
| | format, try "$comment_author_i_p"
| |
(WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase)
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56261#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list