• Hi,
    I simply would like to add an option for users to delete their own posts on my website.
    The porblem is : the text and the confirmation box shows up, it takes the user back to the homepage but Nothing happenned, the post is still there.
    Could someone help me ?

    Here’s the “single.php” of my theme with my code in it:
    <!–
    <?php get_header(); ?>

    <?php get_sidebar(); ?>

    <?php hu_get_content( ‘tmpl/single-tmpl’); ?>

    <?php if ($post->post_author == $current_user->ID) { ?>
    ???<p>ID ); ?>”>Delete post</p>
    <?php } ?>

    <?php get_footer(); ?> */
    –>

Viewing 1 replies (of 1 total)
  • Thread Starter danktv

    (@danktv)

    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>
    
    <?php hu_get_content( 'tmpl/single-tmpl'); ?>
    
    <?php if ($post->post_author == $current_user->ID) { ?>
    ???<p><a onclick="return confirm('Are you SURE you want to delete this post?')" href="<?php echo get_delete_post_link( $post->ID ); ?>">Delete post</a></p>
    <?php } ?>
    
    <?php get_footer(); ?> */
Viewing 1 replies (of 1 total)
  • The topic ‘get_delete_post_link not working’ is closed to new replies.