[wp-trac] [WordPress Trac] #12955: Add get_post filter
WordPress Trac
noreply at wordpress.org
Sun Jun 7 19:40:13 UTC 2015
#12955: Add get_post filter
-------------------------------+-----------------------------
Reporter: JohnLamansky | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch filter | Focuses:
-------------------------------+-----------------------------
Comment (by danieliser):
I support this as well. Use case, attaching extra fields into the post
object.
Currently got a working concept for something like a partner table for
posts, such as location information. This is useful in itself since
querying post meta for radius location searches is very taxing if you have
say 50k listings(CPT). A second table to manage these means easily
querying using built in MySQL methods for these types of searches.
This patch applies simply because say I have address info in a partner
table, I can then join that row to the post object so that $post->city,
$post->state etc are available. Currently I am using a wrapper function
that simply calls get_post() and then appends the extra keys. But being
able to filter these on the initial get_post call would mean one less
step. I'm sure there are many other uses for this as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12955#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list