WordPress.org

Ready to get started?Download WordPress

Forums

Adding a "Delete comment" to comments section (2 posts)

  1. XeroCool
    Member
    Posted 9 years ago #

    When someone posts and I'm logged in admin and I view their comments, I want to add a delete comment option. Like this. Right now, Its:

    Comment by xxxxx � xxxxx @ xxx | Edit This

    Next to Edit This, I want a delete this or delete comment link. How would I do this? Thanks :)

  2. Kafkaesqui

    Posted 9 years ago #

    This should start you on your way to something usable:

    <?php get_currentuserinfo(); if ($user_level > 0) { ?>
    <a href="wp-admin/post.php?action=confirmdeletecomment&amp;noredir=false&amp;comment=<?php comment_ID(); ?>&amp;p=<?php the_ID(); ?>">Delete comment</a>
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.