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