[wp-trac] [WordPress Trac] #40850: WP_Query->have_posts() -- add action if no results are found
WordPress Trac
noreply at wordpress.org
Wed Jun 21 19:13:15 UTC 2017
#40850: WP_Query->have_posts() -- add action if no results are found
-------------------------+------------------
Reporter: mgibbs189 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.9
Component: Query | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+------------------
Changes (by boonebgorges):
* keywords: has-patch => needs-patch
* milestone: Awaiting Review => 4.9
Comment:
Hi @mgibbs189 - Sorry for the delay in reviewing the patch.
Adding an action here seems like a fine idea, and your technique for
firing the action - in an `elseif ( 0 === $this->post_count )` clause -
seems like the most efficient way to do it.
A couple small requests on the patch:
* The `@since` annotation needs updating for 4.9, and we generally use the
three-digit format: `@since 4.9.0`. See
https://make.wordpress.org/core/handbook/best-practices/inline-
documentation-standards/php/#since-section-changelogs
* The use of `do_action_ref_array( ..., array( &$this ) )` is a legacy of
PHP4 support. `do_action( ..., $this )` should be sufficient - the object
ought to be passed by reference automatically.
Thanks!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40850#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list