[wp-trac] [WordPress Trac] #56791: Coding Standards fixes for WP 6.2

WordPress Trac noreply at wordpress.org
Mon Feb 13 23:11:12 UTC 2023


#56791: Coding Standards fixes for WP 6.2
----------------------------+-------------------------------
 Reporter:  desrosj         |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  6.2
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  coding-standards
----------------------------+-------------------------------

Comment (by jrf):

 Replying to [comment:38 azaozz]:
 > Replying to [comment:37 SergeyBiryukov]:
 >
 > > While matching the database field of the same name, the `$comment_ID`
 variable did not follow the WordPress coding standards...
 >
 > I like this change, seems to make sense imho. However there is nothing
 about this in the WP coding standards (as far as I see). Seems the
 implementation of the standards in WPCS is wrong :)

 From the handbook:
 > Use lowercase letters in variable, action/filter, and function names
 (never camelCase). Separate words via underscores. Don’t abbreviate
 variable names unnecessarily; let the code be unambiguous and self-
 documenting.

 Ref: https://developer.wordpress.org/coding-standards/wordpress-coding-
 standards/php/#naming-conventions

 Note: this phrase has been in the handbook since as long as I remember.
 Also see the [https://github.com/WordPress/wpcs-
 docs/commit/2568ca56640ba5f85c09e77e4d8fca05362cae57 original import to
 the Git repo] from five years ago in which the exact same phrase is
 included.

 Conclusion: WPCS follows the handbook to the letter and is doing nothing
 wrong here.

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


More information about the wp-trac mailing list