[wp-trac] [WordPress Trac] #54769: INNER JOIN missing "AS" in /wp-includes/link-template.php

WordPress Trac noreply at wordpress.org
Sun Jan 9 00:07:12 UTC 2022


#54769: INNER JOIN missing "AS" in /wp-includes/link-template.php
---------------------------+---------------------
 Reporter:  domainsupport  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  6.0
Component:  Database       |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+---------------------
Changes (by costdev):

 * type:  defect (bug) => enhancement
 * milestone:  Awaiting Review => 6.0


Comment:

 @domainsupport thanks for opening this ticket.

 While `AS` is an optional keyword in SQL, meaning that this isn't a
 `defect (bug)`, it is commonly considered best practice to include the
 `AS` keyword for better readability and compatibility.

 To my knowledge, this doesn't fall under any of the official coding
 standards in WordPress, but this query and ''almost'' every other `INNER
 JOIN` that uses aliases in Core includes the `AS` keyword - the one other
 exception I could find was in `src\wp-includes\taxonomy.php:2536`.

 For the reason(s) above as well as consistency in Core, I think we should
 add the `AS` keyword in both of these files.

 Milestoning this for `6.0` and marking as an `enhancement`.

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


More information about the wp-trac mailing list