Filters a review before it is inserted via the REST API. Allows modification of the review right before it is inserted via wp_insert_comment(). Returning a WP_Error value from the filter will shortcircuit insertion and allow skipping further processing.
$prepared_review, $request
Sortie :
@param array|WP_Error $prepared_review The prepared review data for wp_insert_comment(). @param WP_REST_Request $request Request used to insert the review.
// Modifier la valeur avec le filtre 'woocommerce_rest_pre_insert_product_review'
add_filter('woocommerce_rest_pre_insert_product_review', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($prepared_review) {
// Modifier la valeur
return $prepared_review;
}
Chargement des actualités...