function add_youtube_comment_as_review($post_id, $recipe_id, $youtube_author, $youtube_text, $rating, $youtube_url = '', $youtube_comment_id = '') { $slug = strtolower(preg_replace('/[^a-z0-9]+/', '.', $youtube_author)); $email = 'piattorecipes+' . $slug . '@gmail.com'; $author_name = $youtube_author . ' (from YouTube)'; $comment_content = $youtube_text; // Randomly add rel="nofollow" to ~70% of links to avoid looking spammy $rel_attr = (mt_rand(1, 100) <= 70) ? 'nofollow noopener' : 'noopener'; if (!empty($youtube_url)) { $comment_content .= "\n\nOriginal comment: View on YouTube"; } $comment_id = wp_insert_comment([ 'comment_post_ID' => $post_id, 'comment_author' => $author_name, 'comment_author_email' => $email, 'comment_content' => $comment_content, 'comment_approved' => 1, 'comment_type' => '', 'user_id' => 0, ]); if (!is_wp_error($comment_id)) { update_comment_meta($comment_id, 'wprm_rating', $rating); update_comment_meta($comment_id, 'rating', $rating); update_comment_meta($comment_id, 'wprm_recipe_id', $recipe_id); update_comment_meta($comment_id, 'wprm_verified', 1); update_comment_meta($comment_id, 'wprm_comment_source', 'manual'); update_comment_meta($comment_id, 'youtube_comment_id', $youtube_comment_id); wp_update_comment(['comment_ID' => $comment_id]); do_action('edit_comment', $comment_id); if (class_exists('WPRM\WPRM_Recipe_Rating_Manager')) { \WPRM\WPRM_Recipe_Rating_Manager::add_rating($recipe_id, [ 'user_id' => 0, 'comment_id' => $comment_id, 'rating' => $rating, 'ip' => '127.0.0.1', 'source' => 'manual', ]); \WPRM\WPRM_Recipe_Rating_Manager::update_recipe_rating($recipe_id); } do_action('comment_post', $comment_id, $comment_content, 1); do_action('wprm_comment_added', $comment_id); delete_transient('wprm_recipe_' . $recipe_id . '_rating_data'); } return $comment_id; } Mediterranean Archives – Page 16 of 19 – PIATTO RECIPES

Mediterranean

Pork Ragu Recipe

This is the beloved Wild Boar Ragù traditionally served in Italy with pappardelle pasta. If you can't find wild pig (aka wild boar) in your neck of the woods, you can substitute boneless pork, beef, bison or lamb. We recommend using wild game meat or a gamier meat as it will more closely resemble the flavor that you'll get when cooking wild boar in the authentic Italian recipe we present here.