[wp-trac] [WordPress Trac] #41843: Provide more flexibility to the `get_{$adjacent}_post_where` hook
WordPress Trac
noreply at wordpress.org
Sat Sep 9 15:33:09 UTC 2017
#41843: Provide more flexibility to the `get_{$adjacent}_post_where` hook
-------------------------+-----------------------------
Reporter: danburzo | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
I'm working on getting the previous/next post for a Custom Post Type based
on a certain postmeta value, and the `get_{$adjacent}_post_where` seems
the appropriate hook for this. However, it currently receives the whole
WHERE clause as a parameter. IMO it would be ideal to be able to override
just the `WHERE p.post_date $op %s AND p.post_type = %s` part and keep the
other (useful ones) intact.
This could potentially be solved in a non-breaking way by sending `$where`
as it stands ''before'' concatenation with `WHERE p.post_date $op %s AND
p.post_type = %s`, so that authors can neatly plugin a postmeta condition.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41843>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list