Block Editor: Remove the latest "gutenberg" mention in the latest-comments.php file

Props swissspidy.
See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43951


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2018-11-30 13:36:47 +00:00
parent 50b094e3b0
commit d71ccc69e3
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@
* @package WordPress * @package WordPress
*/ */
if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) { if ( ! function_exists( 'wp_latest_comments_draft_or_post_title' ) ) {
/** /**
* Get the post title. * Get the post title.
* *
@ -26,7 +26,7 @@ if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) {
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @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. * @return string The post title if set; "(no title)" if no title is set.
*/ */
function wp_latest_comments_draft_or_post_title( $post = 0 ) { function gutenberg_draft_or_post_title( $post = 0 ) {
$title = get_the_title( $post ); $title = get_the_title( $post );
if ( empty( $title ) ) { if ( empty( $title ) ) {
$title = __( '(no title)' ); $title = __( '(no title)' );
@ -42,7 +42,7 @@ if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) {
* *
* @return string Returns the post content with latest comments added. * @return string Returns the post content with latest comments added.
*/ */
function render_block_core_latest_comments( $attributes = array() ) { function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
// This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php. // This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php.
$comments = get_comments( $comments = get_comments(
apply_filters( apply_filters(
@ -94,7 +94,7 @@ function render_block_core_latest_comments( $attributes = array() ) {
// `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in
// `esc_html`. // `esc_html`.
$post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>'; $post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . gutenberg_draft_or_post_title( $comment->comment_post_ID ) . '</a>';
$list_items_markup .= sprintf( $list_items_markup .= sprintf(
/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */ /* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
@ -179,6 +179,6 @@ register_block_type(
'enum' => array( 'center', 'left', 'right', 'wide', 'full', '' ), 'enum' => array( 'center', 'left', 'right', 'wide', 'full', '' ),
), ),
), ),
'render_callback' => 'render_block_core_latest_comments', 'render_callback' => 'gutenberg_render_block_core_latest_comments',
) )
); );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-RC1-43950'; $wp_version = '5.0-RC1-43951';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.