Flushing Object Cache Needed when Comment Posted
-
When a comment is posted, the recent comments widget is not updated unless I manually flush the object cache. Is there a function I can use when the comment posted hook is triggered, or is there another recommended approach so the comment is pushed to the widget? Something such as:
function cm_flush_object_cache( $comment_ID, $comment_approved ) { if( 1 === $comment_approved ){ //object flush cache logic goes here } } add_action( 'comment_post', 'cm_flush_object_cache', 10, 2 );
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Flushing Object Cache Needed when Comment Posted’ is closed to new replies.