Opened 8 years ago
Closed 8 years ago
#40080 closed defect (bug) (invalid)
Yoda condition is missing in some files
Reported by: | viralsampat | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
I have checked some core files in that inside some files I found the 'if' conditional statement is not obeying the rule of 'Yoda' Condition.
As per this link https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#yoda-conditions . Every 'if' Statement should follow 'Yoda Condition' rule.
Below is the file URL:-
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php#L2434
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi @viralsampat, welcome to WordPress Trac! Thanks for the ticket.
WordPress generally discourages code refactoring just for the sake of formatting cleanup. Coding style fixes should be a result of more substantial changes: https://make.wordpress.org/core/handbook/contribute/code-refactoring/.