From 38dd307f5a3f0613ae0007588884290691479b9d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 28 Oct 2019 19:33:24 +0000 Subject: [PATCH] Docs: Coding standards fix after [46608]. See #48303 git-svn-id: https://develop.svn.wordpress.org/trunk@46609 602fd350-edb4-49c9-b593-d223f7449a82 --- .../endpoints/class-wp-rest-attachments-controller.php | 6 ++++-- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index b5d6a04a8d..409d61d43c 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -406,9 +406,11 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { if ( in_array( 'caption', $fields, true ) ) { /** This filter is documented in wp-includes/post-template.php */ - $caption = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); + $caption = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); + /** This filter is documented in wp-includes/post-template.php */ - $caption = apply_filters( 'the_excerpt', $caption ); + $caption = apply_filters( 'the_excerpt', $caption ); + $data['caption'] = array( 'raw' => $post->post_excerpt, 'rendered' => $caption, diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 428a5ff31b..a0d3fe805d 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1558,9 +1558,11 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { if ( rest_is_field_included( 'excerpt', $fields ) ) { /** This filter is documented in wp-includes/post-template.php */ - $excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); + $excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); + /** This filter is documented in wp-includes/post-template.php */ - $excerpt = apply_filters( 'the_excerpt', $excerpt ); + $excerpt = apply_filters( 'the_excerpt', $excerpt ); + $data['excerpt'] = array( 'raw' => $post->post_excerpt, 'rendered' => post_password_required( $post ) ? '' : $excerpt,