Make WordPress Core

Changeset 57176

Timestamp:
12/09/2023 10:11:45 PM (8 months 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.

Location:
trunk
Files:
2 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 ),
    10951095                'raw'      => $comment->comment_content,
    10961096            );
  • trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php

    r56549 r57176  
    965965            array_keys( $response->get_data() )
    966966        );
     967
     968
     969
     970
     971
     972
     973
     974
     975
     976
     977
     978
     979
     980
     981
    967982    }
    968983
Note: See TracChangeset for help on using the changeset viewer.