i-recommend-this
i-recommend-this copied to clipboard
Add do_action("after_recommend",$post_id) hook for customization and cache refresh
When using cache systems the browser is not updated after casting a vote/recommendation.
For now I hook update_post_meta and added_post_meta to check if the field _recommended is set.
It would be nice to use add_action to hook the plugins do_action hook instead.
add_action( 'added_post_meta', 'my_after_post_meta', 10, 4 );
add_action( 'updated_post_meta', 'my_after_post_meta', 10, 4 );
function my_after_post_meta( $meta_id, $post_id, $meta_key, $meta_value )
{
if ( '_recommended' == $meta_key ) {
//clear cache of $post_id
}
}