Skip to content

Commit e9dbda1

Browse files
committed
Respect disabled block allowlists
1 parent 7990cb4 commit e9dbda1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

includes/classes/Comments/Comments.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,13 @@ public function remove_comment_blocks( $allowed_block_types ) {
437437
*/
438438
$disallowed_blocks = apply_filters( 'tenup_experience_disable_comments_disallowed_blocks', $disallowed_blocks );
439439

440-
// Get all registered blocks if $allowed_block_types is not already set.
441-
if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) {
440+
// Respect other filters that have disabled all blocks.
441+
if ( false === $allowed_block_types ) {
442+
return false;
443+
}
444+
445+
// Get all registered blocks if all blocks are allowed or no explicit list is set.
446+
if ( true === $allowed_block_types || ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) {
442447
$registered_blocks = \WP_Block_Type_Registry::get_instance()->get_all_registered();
443448
$allowed_block_types = array_keys( $registered_blocks );
444449

0 commit comments

Comments
 (0)