rest_preprocess_comment WordPress Filter Hook

The rest_preprocess_comment hook is used to preprocess data for a comment before it is inserted into the database. This hook is called before the comment is sanitized, so you can use it to modify data before it is sanitized.

apply_filters( 'rest_preprocess_comment', array $prepared_comment, WP_REST_Request $request ) #

Filters a comment added via the REST API after it is prepared for insertion into the database.


Description

Allows modification of the comment right after it is prepared for the database.


Top ↑

Parameters

$prepared_comment

(array)The prepared comment data for wp_insert_comment.

$request

(WP_REST_Request)The current request.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.