Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server side registration to fix translation #2826

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/wp-includes/blocks/comments-query-loop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Server-side rendering of the `core/comments-query-loop` block.
*
* @package WordPress
*/

/**
* Registers the `core/comments-query-loop` block on the server.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe add a note somewhere in these comments why we need this file (with a reference to this PR or the discussion in WordPress/gutenberg#41292), as it might otherwise be very tempting to remove it 😬

function register_block_core_comments_query_loop() {
register_block_type_from_metadata(
__DIR__ . '/comments-query-loop'
);
}
add_action( 'init', 'register_block_core_comments_query_loop' );
1 change: 1 addition & 0 deletions src/wp-includes/blocks/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-previous.php';
require ABSPATH . WPINC . '/blocks/comments-pagination.php';
require ABSPATH . WPINC . '/blocks/comments-query-loop.php';
require ABSPATH . WPINC . '/blocks/comments-title.php';
require ABSPATH . WPINC . '/blocks/cover.php';
require ABSPATH . WPINC . '/blocks/file.php';
Expand Down