Thread Starter
Brayne
(@brayne)
Detective work complete.
My objective was to do a query_posts using meta_key and meta_value_num based on the most recent comment. So I’m storing a timestamp in the postmeta. Here is the code I can up with and it’s working great.
function recent_comment_timestamp() {
global $comment_post_ID;
$meta_key = 'recent_comment_timestamp';
$meta_value = time();
update_post_meta($comment_post_ID, $meta_key, $meta_value);
}
add_action( 'wp_insert_comment', 'recent_comment_timestamp' );
(@brayne)
15 years, 2 months ago
I want to save a timestamp to postmeta when a comment is made on that post. I just can’t figure out what hook to use when I want to insert the postmeta…
Any Ideas?
thanks in advance.