woocommerce_rest_preprocess_product_review

FILTER woocommerce\includes\rest-api\Controllers\Version3\class-wc-rest-product-reviews-controller.php (ligne 805) github
Filters a review after it is prepared for the database. Allows modification of the review right after it is prepared for the database.

Paramètres

Entrée :
$prepared_review, $request
Sortie :
@param array           $prepared_review The prepared review data for `wp_insert_comment`.
@param WP_REST_Request $request         The current request.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_rest_preprocess_product_review'
add_filter('woocommerce_rest_preprocess_product_review', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($prepared_review) {
    // Modifier la valeur
    return $prepared_review;
}

Actualités

Chargement des actualités...