Non Users Delete Posts
How can I allow non users to delete posts?
I am currently using this code:
<?php
global $wp_query;
$cat = get_the_category();
if ($cat[0]->cat_ID == 86){
$url = get_bloginfo('url');
echo "<a>ID) . "'>Delete post</a>";
}
?>
This adds a delete link if the current post is in a certain category. It works perfec开发者_运维百科tly but It requires a user with edit privileges to be logged in. How can I change this to allow for regular, non registered users to delete posts?
Any help is appreciated.
You have two options:
1) Promote non-users into users by giving them a session to uniquely identify them and relate each poster with their posts. This requires additional session storage for non-users.
2) Generate a unique hash for each post and provide in the view page a once-only option to delete the post. Similarly to imgur.com, they can still delete the post if they saved the link but will not be presented again. This saves server state.
精彩评论