wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



rest_pre_insert_comment › WordPress Filter Hooks

Seit4.8.0
Veraltetn/v
apply_filters( 'rest_pre_insert_comment', $prepared_comment, $request )
Parameter: (2)
  • (array|WP_Error) $prepared_comment The prepared comment data for wp_insert_comment().
    Erforderlich: Ja
  • (WP_REST_Request) $request Request used to insert the comment.
    Erforderlich: Ja
Definiert in:
Codex:

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.





Quellcode

$prepared_comment = apply_filters( 'rest_pre_insert_comment', $prepared_comment, $request );