Preview of Custom Posts
-
I have strange problem with querying custom post types via WP_Query.
Site users can post via frontend in my project. I want to give chance to edit their posts while its still in pending review status.
My WP_Query is like that in users post edit page that we are using frontend:
$details = new WP_Query( array( "post_type" => "custom", //"author" => $current_user->ID , "p" => $postid, "post_status" => array('publish','pending','draft','trash','future'), "showposts" => 1 ) );this is returning null while the sql code given from $details->request, returns correct data from phpmyadmin. This style of code working in administrative or editor level, while not working in standart user mode.
Users are also able to edit their posts if their post are already in published status.
the another weird thing is if i remove backslashes from author parameter and i comment the “p” parameter, this time it starts to return data in standart user level. But its always returns users first record.
So users can not edit their posts until its approved by editors, worst side is if the post rejected by us, they can’t edit the post.
Actually it’s similar like preview feature.
I find this topic very similar to my problem, but they didn’t find any solution.
http://wordpress.org/support/topic/preview-custom-post-type-posts?replies=7
The topic ‘Preview of Custom Posts’ is closed to new replies.