[wp-hackers] Adding edit, umapprove and mark as spam in comments area
Daniel Fenn
danielx386 at gmail.com
Sat Dec 15 00:50:50 UTC 2012
Hey guys,
Thankyou for the answers. I've taken a look at the link provided by Patty
and that is really close to what I am after. What I ended up doing is
taking the code from that blog and extending it so that it almost like ajax
but it not.
For those who are wondering what I ended up with (and I'm still working on
it) this is what I got:
function comment_mod_link($id) {
if (current_user_can('edit_posts')) {
$del_nonce = esc_html('_wpnonce=' .
wp_create_nonce("delete-comment_$id"));
$approve_nonce = esc_html('_wpnonce=' .
wp_create_nonce("approve-comment_$id"));
$_wp_original_http_referer = '_wp_original_http_referer=' .
apply_filters('the_permalink', get_permalink());
echo '<li class="edit-icon"><a
href="'.admin_url("comment.php?action=editcomment&c=$id&$_wp_original_http_referer").'"></a></li>
';
echo '<li class="wp-delete-icon"><a
href="'.admin_url("comment.php?action=trashcomment&c=$id&$del_nonce&$_wp_original_http_referer").'"></a></li>
';
echo '<li class="wp-info-icon"><a
href="'.admin_url("comment.php?action=spamcomment&c=$id&$del_nonce&$_wp_original_http_referer").'"></a></li>';
}
}
Now all I do is need to figure out how to show comments that are waiting to
be approved, marked as spam and deleted to current_user_can('edit_posts')
so that all of that can be managed without going to wp-admin.
Chris,
While that would have done the job, I wanted to try something different and
do some coding myself. And by doing that one can learn more about what
going on inside wordpress.
Regards,
Daniel Fenn
On Sat, Dec 15, 2012 at 4:02 AM, chris mccoy <chris at lod.com> wrote:
> http://wordpress.org/extend/plugins/wp-ajax-edit-comments/
>
> this should do what you want.
>
> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Patty Ayers
> Sent: December 14, 2012 10:56 AM
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Adding edit, umapprove and mark as spam in
> comments area
>
> Hello - I've seen a good tutorial on this - couldn't find it, but found
> these two:
>
>
> http://wp.smashingmagazine.com/2009/07/23/10-wordpress-comments-hacks/#more-
> 8348
> http://new2wp.com/snippet/spam-delete-links-comments-frontend/
>
> Not Ajax, though..
>
> P at tty
>
>
> On Wed, Dec 12, 2012 at 8:55 PM, Daniel Fenn <danielx386 at gmail.com> wrote:
>
> > Hello guys,
> >
> > Just wondering, does anyone here know how I can add "edit", "mark as
> spam"
> > and "umapprove" links in the comment loop in my wordpress theme?
> >
> > Also if it not that hard I would like the "mark as spam" and "umapprove"
> > links to be ajax or at the very lease have it so it does it job then
> > take me back to the page that I was on.
> > Regards,
> > Daniel Fenn
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list