From 50b094e3b0a409da45cf068887157c5693ab46b3 Mon Sep 17 00:00:00 2001 From: youknowriad Date: Fri, 30 Nov 2018 13:24:45 +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. Built from https://develop.svn.wordpress.org/branches/5.0@43950 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43782 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/archives.php | 14 +++++++------- wp-includes/blocks/categories.php | 2 +- wp-includes/blocks/latest-comments.php | 14 +++++++------- wp-includes/blocks/latest-posts.php | 2 +- wp-includes/version.php | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/wp-includes/blocks/archives.php b/wp-includes/blocks/archives.php index a561fdfa68..3d7b5b42f4 100644 --- a/wp-includes/blocks/archives.php +++ b/wp-includes/blocks/archives.php @@ -32,7 +32,7 @@ function render_block_core_archives( $attributes ) { $class .= ' wp-block-archives-dropdown'; $dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) ); - $title = __( 'Archives', 'default' ); + $title = __( 'Archives' ); /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */ $dropdown_args = apply_filters( @@ -50,19 +50,19 @@ function render_block_core_archives( $attributes ) { switch ( $dropdown_args['type'] ) { case 'yearly': - $label = __( 'Select Year', 'default' ); + $label = __( 'Select Year' ); break; case 'monthly': - $label = __( 'Select Month', 'default' ); + $label = __( 'Select Month' ); break; case 'daily': - $label = __( 'Select Day', 'default' ); + $label = __( 'Select Day' ); break; case 'weekly': - $label = __( 'Select Week', 'default' ); + $label = __( 'Select Week' ); break; default: - $label = __( 'Select Post', 'default' ); + $label = __( 'Select Post' ); break; } @@ -101,7 +101,7 @@ function render_block_core_archives( $attributes ) { $block_content = sprintf( '
%2$s
', $classnames, - __( 'No archives to show.', 'default' ) + __( 'No archives to show.' ) ); } else { diff --git a/wp-includes/blocks/categories.php b/wp-includes/blocks/categories.php index ed5f5ba376..f302d9ba74 100644 --- a/wp-includes/blocks/categories.php +++ b/wp-includes/blocks/categories.php @@ -27,7 +27,7 @@ function render_block_core_categories( $attributes ) { if ( ! empty( $attributes['displayAsDropdown'] ) ) { $id = 'wp-block-categories-' . $block_id; $args['id'] = $id; - $args['show_option_none'] = __( 'Select Category', 'default' ); + $args['show_option_none'] = __( 'Select Category' ); $wrapper_markup = '
%2$s
'; $items_markup = wp_dropdown_categories( $args ); $type = 'dropdown'; diff --git a/wp-includes/blocks/latest-comments.php b/wp-includes/blocks/latest-comments.php index fc8a88cc2e..44a3dce8ae 100644 --- a/wp-includes/blocks/latest-comments.php +++ b/wp-includes/blocks/latest-comments.php @@ -26,10 +26,10 @@ if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) { * @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)', 'default' ); + $title = __( '(no title)' ); } return esc_html( $title ); } @@ -42,7 +42,7 @@ if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) { * * @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,11 +94,11 @@ 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 */ - __( '%1$s on %2$s', 'default' ), + __( '%1$s on %2$s' ), $author_markup, $post_title ); @@ -143,7 +143,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) { ) : sprintf( '
%2$s
', $classnames, - __( 'No comments to show.', 'default' ) + __( 'No comments to show.' ) ); return $block_content; @@ -179,6 +179,6 @@ register_block_type( 'enum' => array( 'center', 'left', 'right', 'wide', 'full', '' ), ), ), - 'render_callback' => 'gutenberg_render_block_core_latest_comments', + 'render_callback' => 'render_block_core_latest_comments', ) ); diff --git a/wp-includes/blocks/latest-posts.php b/wp-includes/blocks/latest-posts.php index 5ef169ae69..18a43e5182 100644 --- a/wp-includes/blocks/latest-posts.php +++ b/wp-includes/blocks/latest-posts.php @@ -33,7 +33,7 @@ function render_block_core_latest_posts( $attributes ) { $title = get_the_title( $post_id ); if ( ! $title ) { - $title = __( '(Untitled)', 'default' ); + $title = __( '(Untitled)' ); } $list_items_markup .= sprintf( '
  • %2$s', diff --git a/wp-includes/version.php b/wp-includes/version.php index 06b5efb1eb..d6f1fe0023 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-RC1-43949'; +$wp_version = '5.0-RC1-43950'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.