Forums

delete post link front end (4 posts)

  1. vincentlopy
    Member
    Posted 1 year ago #

    Hello, Im using this code to remove post from frontend in wordpress:

    Code from pastebin

    This code works good but if I use custom post type I get this error page from wordpress: Please try again.

    Any help please?

  2. Creative Slice
    Member
    Posted 10 months ago #

    I'm having the same issue and I'm pretty sure it has to do with this URL not working for custom post types. Can anybody help?

    echo "<a href='" . wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&post=" . $post->ID, 'delete-post_' . $post->ID) . "

  3. gaberosser
    Member
    Posted 8 months ago #

    I'm having the same issue. Just wanted to see if there had been any resolution on this yet.

  4. gaberosser
    Member
    Posted 8 months ago #

    Hey! After scouring the webernets, I found this solution:

    Insert this into functions: http://pastebin.com/hede4ayF
    Then call on it in page: <?php echo wp_delete_post_link(); ?>

    Thanks to this post: http://wordpress.stackexchange.com/questions/28292/delete-post-link-to-delete-post-its-meta-and-attachments

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.