Changeset 57176
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r56747 r57176 1092 1092 $data['content'] = array( 1093 1093 /** 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() ), 1095 1095 'raw' => $comment->comment_content, 1096 1096 ); -
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r56549 r57176 965 965 array_keys( $response->get_data() ) 966 966 ); 967 } 968 969 /** 970 * @ticket 58238 971 */ 972 public function test_prepare_item_comment_text_filter() { 973 $filter = new MockAction(); 974 add_filter( 'comment_text', array( $filter, 'filter' ), 10, 3 ); 975 976 $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%d', self::$approved_id ) ); 977 978 $response = rest_get_server()->dispatch( $request ); 979 980 $this->assertSame( 1, $filter->get_call_count() ); 981 $this->assertCount( 3, $filter->get_args()[0] ); 967 982 } 968 983
Note: See TracChangeset
for help on using the changeset viewer.