Skip to content

Commit

Permalink
Move module registration to correct filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Dec 12, 2023
1 parent 2d806dc commit 85868c2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/block-library/src/comments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ function register_block_core_comments() {
'skip_inner_blocks' => true,
)
);

if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
gutenberg_register_module(
'@wordpress/block-library/comments',
gutenberg_url( '/build/interactivity/comments.min.js' ),
array( '@wordpress/interactivity' ),
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
);
}
}
add_action( 'init', 'register_block_core_comments' );

Expand Down Expand Up @@ -236,14 +245,5 @@ function register_legacy_post_comments_block() {
$metadata = apply_filters( 'block_type_metadata', $metadata );

register_block_type( 'core/post-comments', $metadata );

if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
gutenberg_register_module(
'@wordpress/block-library/comments',
gutenberg_url( '/build/interactivity/comments.min.js' ),
array( '@wordpress/interactivity' ),
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
);
}
}
add_action( 'init', 'register_legacy_post_comments_block', 21 );

0 comments on commit 85868c2

Please sign in to comment.