From c52baf9de4cbc7b6d8882b0308af7a6477576a45 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 30 Nov 2018 13:23:09 +0000 Subject: [PATCH] Block Editor: Rename the gutenberg_ functions in blocks/latest-comments.php. This was ported manually from https://github.com/WordPress/gutenberg/pull/12326 Props pento, swissspidy. See #45145. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43950 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/blocks/latest-comments.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/blocks/latest-comments.php b/src/wp-includes/blocks/latest-comments.php index 29e17e9de5008..44a3dce8ae6b8 100644 --- a/src/wp-includes/blocks/latest-comments.php +++ b/src/wp-includes/blocks/latest-comments.php @@ -26,7 +26,7 @@ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @return string The post title if set; "(no title)" if no title is set. */ - function gutenberg_draft_or_post_title( $post = 0 ) { + function wp_latest_comments_draft_or_post_title( $post = 0 ) { $title = get_the_title( $post ); if ( empty( $title ) ) { $title = __( '(no title)' ); @@ -42,7 +42,7 @@ function gutenberg_draft_or_post_title( $post = 0 ) { * * @return string Returns the post content with latest comments added. */ -function gutenberg_render_block_core_latest_comments( $attributes = array() ) { +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( apply_filters( @@ -94,7 +94,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) { // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in // `esc_html`. - $post_title = '' . gutenberg_draft_or_post_title( $comment->comment_post_ID ) . ''; + $post_title = '' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . ''; $list_items_markup .= sprintf( /* translators: 1: author name (inside or tag, based on if they have a URL), 2: post title related to this comment */ @@ -179,6 +179,6 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) { 'enum' => array( 'center', 'left', 'right', 'wide', 'full', '' ), ), ), - 'render_callback' => 'gutenberg_render_block_core_latest_comments', + 'render_callback' => 'render_block_core_latest_comments', ) );