[wp-trac] [WordPress Trac] #41825: wp_link_query not applied if method finds nothing

WordPress Trac noreply at wordpress.org
Sat Sep 9 21:43:07 UTC 2017


#41825: wp_link_query not applied if method finds nothing
---------------------------------------------+-------------------------
 Reporter:  msebel                           |       Owner:  swissspidy
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  4.9
Component:  Editor                           |     Version:  3.7
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:6 ramiy]:
 > I think the `return` output can be more readable.

 Testing for non-empty results is generally more intuitive, per the
 [https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/#ternary-operator coding standards].

 We could probably just omit `empty()` altogether: `return $results ?
 $results : false;`

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


More information about the wp-trac mailing list