- This topic has 3 replies, 2 voices, and was last updated 1 year, 1 month ago by .
With wp_instert_post we can create and add meta data to the post at the same time.
Is there a get_post (or even better get_posts) counterpart that will allow us to grab posts with meta fields without the need of using get_post_meta for each custom field?
Given how metabox defines its custom fields, it should be possible to create a function that will get all fields at once by referencing the field group. I am currently doing something like this but I end up calling the metabox get meta wrapper function in a foreach cycle.
It would be ideal to make a join and grab a post with all its meta, querying the DB only once.
Has this been considered?
Is this already available?
- You must be logged in to reply to this topic.