-
When a user creates a new post it will have “pending” status. So I want the visitor (guest – not logged user) to be able to view “Pending” posts and vote it to “Publish” if enough “X Votes”. Google bot can also crawl “Pending” Posts.
-
I want to use permalink for “Pending” Post.
How can I do this?
Please help me! Thanks all friends!
The best way to do that is with this plugin:
https://wordpress.org/plugins/public-post-preview/
OF course you can dig into it’s source code to try to implement the core functionality if you prefer, but I use that plugin on several active sites with success.
For displaying “Pending” post to the users you can add “post_status” parameter to
get_post()
orwp_query
function likepost_status (string / array) – use post status. Retrieves posts by Post Status. Default value is ‘publish’, but if the user is logged in, ‘private’ is added. And if the query is run in an admin context (administration area or AJAX call), protected statuses are added too. By default protected statuses are ‘future’, ‘draft’ and ‘pending’.
Or you can check the wordpress codex for other help.