I am looking for an equivalent of getting a page/post with WP Query or get_posts e.g.:
$args=array(
'category' => 1,
'name' => 'my-page',
'post_type' => 'page',
'post_status' => 'publish',
'numberposts' => 1
);
$my_post = get_posts($args);
but I want this for a preview, only thing I have are the preview GET parameters:
?preview=true&preview_id=5&preview_nonce=b0d41a7fdb
The preview_id
is actually the ID of the created post, not the id of the preview.
Any ideas?
So I eventually found a possible answer – this should retrieve the latest preview or “revision”: