From 817807e5be30ae74a45182e2b5c9acf46bb1e523 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 28 Oct 2019 19:04:05 +0000 Subject: [PATCH] Docs: Remove some funky nested filters. See #48303 Built from https://develop.svn.wordpress.org/trunk@46608 git-svn-id: http://core.svn.wordpress.org/trunk@46405 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/latest-comments.php | 2 +- .../endpoints/class-wp-rest-attachments-controller.php | 4 +++- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 4 +++- wp-includes/version.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/blocks/latest-comments.php b/wp-includes/blocks/latest-comments.php index 3cade8f2a9..d68e89a152 100644 --- a/wp-includes/blocks/latest-comments.php +++ b/wp-includes/blocks/latest-comments.php @@ -41,8 +41,8 @@ function wp_latest_comments_draft_or_post_title( $post = 0 ) { * @return string Returns the post content with latest comments added. */ function render_block_core_latest_comments( $attributes = array() ) { + // This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php. $comments = get_comments( - /** This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php */ apply_filters( 'widget_comments_args', array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 571d207803..b5d6a04a8d 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -406,7 +406,9 @@ 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( 'the_excerpt', 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 ); $data['caption'] = array( 'raw' => $post->post_excerpt, 'rendered' => $caption, diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 2b71a76cb0..428a5ff31b 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1558,7 +1558,9 @@ 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( 'the_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 ); $data['excerpt'] = array( 'raw' => $post->post_excerpt, 'rendered' => post_password_required( $post ) ? '' : $excerpt, diff --git a/wp-includes/version.php b/wp-includes/version.php index 00a6f576f9..86b5f2aee5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46607'; +$wp_version = '5.4-alpha-46608'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.