16th
Dec
2009
Wordpress: disable moderation for a single comment
I am working an very complex portal based on Wordpress. The more I code, the more I befriend the functions.php file, where all my small tweaks reside. Last in the list (pun!) a super simple action to automatically approve comments belonging to a specific post (which I use as a guestbook):
function approve_guestbook_comments($comment_ID) { $comment = get_comment($comment_ID); if ($comment->comment_post_ID == guestbook_page()) wp_set_comment_status($comment_ID,'approve'); } add_action('comment_post','approve_guestbook_comments');
As you see it’s a super-simple tweak, but it’s quite effective.
Enjoy,
Davide







January 30th, 2010 at 4:29 pm
I don’t know php well. If I wanted to add this feature to another page, is it as simple as replacing the word “guestbook” with the page I want it on?
May 15th, 2010 at 8:58 pm
This blog aided me somewhat in narrowing down some issues with the latest version, Why do they often seem to leave out vital information when they release a new version? It may be minor to them but not to me. I’m sure we’re not alone either.
May 16th, 2010 at 12:59 am
Your blog has helped, thank you. I’ve encountered it maybe once or twice today and will very likely bookmark it. You may want to update wordpress as there is a new version accessible now!
May 16th, 2010 at 1:20 am
Your blog has helped, thanks a ton. I have found it once or twice now and will almost certainly take a note of it. You actually may would like to update wordpress as there exists a brand-new variant accessible now!