how to get the correct wpnonce to approve comments from frontend ?
-
Hi,
My question is in the title, i’d like to add on the frontend a comments approve link (visible only by admins), i’ve already managed to show to admins all pending posts on post list.
I think i’ve got the right link to approve comments (from the admin) :
https://localhost/mysite/wp-admin/comment.php?c=54&action=approvecomment&_wpnonce=ffaa9b1c5d
I just dont undersand how i can generate the right wpnonce from frontend, i’ve seen in the admin files that it seems to use “approve-comment_”+comment_ID to generate it, but i dont get the same using
wp_create_nonce(“approve-comment_”.$comment->comment_ID)
maybe because i use this from a different url , is it possible to get the right one ?
thanks
- The topic ‘how to get the correct wpnonce to approve comments from frontend ?’ is closed to new replies.