Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Hook rest_insert_comment object does not have comment_ID #2340

@ghost

Description

Seem the hook rest_insert_comment does not work as expected. It is fired after a comment is created or updated, so I expect it has a comment_ID but actually it not.

/**
 * Fires after a comment is created or updated via the REST API.
 *
 * @param array           $prepared_comment Inserted comment data.
 * @param WP_REST_Request $request          The request sent to the API.
 * @param boolean         $creating         True when creating a comment, false when updating.
 */
do_action( 'rest_insert_comment', $prepared_comment, $request, true );

The implementation passes $prepared_comment in but not $comment and missing the ID.
Please correct me if I am wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions