I've seen code that looks like this:
get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
What is the definition of the p parameter and is it documented anywhere? I can't find anything about it on the Codex page for get_posts().
'p' is for querying a post, as opposed to 'page_id' for querying a page.
It's documented in the WP_Query codex
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
3 years ago