Make WordPress Core


Ignore:
Timestamp:
12/09/2023 10:11:45 PM (2 years ago)
Author:
SergeyBiryukov
Message:

REST API: Pass correct number of arguments to the comment_text filter.

This ensures that WP_REST_Comments_Controller::prepare_item_for_response() passes three arguments to the comment_text filter, for consistency with all the other instances in core.

Follow-up to [15957], [16357], [25555], [38832], [40664].

Props sjregan, SergeyBiryukov.
Fixes #58238.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r56747 r57176  
    10921092            $data['content'] = array(
    10931093                /** This filter is documented in wp-includes/comment-template.php */
    1094                 'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment ),
     1094                'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment, array() ),
    10951095                'raw'      => $comment->comment_content,
    10961096            );
Note: See TracChangeset for help on using the changeset viewer.