ask and edit an extra comment field

The get_comment_ID function was not working. So use following code in location_meta_call function function location_meta_call(){ $location = get_comment_meta($_GET[“c”],’location’, true); } add_filter(‘comment_save_pre’,’location_save’); function location_save($comment_content){ global $wpdb; $id = $_POST[‘comment_ID’]; $text = $_POST[‘location_meta_box_text’]; update_comment_meta($id , ‘location’, $text); return $comment_content; }

stumped on add_action hook to delete_comment – any ideas?

Unless you’re passing $force_delete as true when calling wp_delete_comment(), the delete_comment hook doesn’t fire. This is because WordPress calls wp_trash_comment() at the beginning of wp_delete_comment() if $force_delete isn’t set true. Try hooking into the trash_comment action hook: function _dbdb_delete_comment( $comment_id ){ $filter = current_filter(); var_dump( $filter ); var_dump( $comment_id ); wp_die( __FUNCTION__ ); } add_action(‘delete_comment’, … Read more

How to use filter on comment submission/insert

There is no wp_notify_postauthor filter, a pluggable function is one you override with your own function: if( ! function_exists(‘wp_notify_postauthor’) ) { function wp_notify_postauthor( $comment_id, $comment_type=”” ) { // your own wp_notify_postauthor code } } I suggest looking at the function in source to see what it does.

Hide Trackbacks/Pingbaks if none exists

I am using a helper function for that. functions.php /** * Count amount of pingbacks + trackbacks for a post. * * @param int $post_id Post ID for comment query. Default is current post. * @return int */ function t5_count_pings( $post_id = NULL ) { $pings = 0; $comments = FALSE; if ( NULL !== … Read more