Skip to content

Commit cd301d0

Browse files
committed
Editor: Rename block visibility support key to visibility.
Renames the support key to `visibility` to avoid conflicting with the Block Visibility plugin's existing `blockVisibility` key. Follow-up to [61014]. Props andrewserong, annezazu, cbravobernal, dlh, jorbin, joen, johnjamesjacoby, palak678, ramonopoly, talldanwp, tyxla, wildworks. Fixes #64272. git-svn-id: https://develop.svn.wordpress.org/trunk@61285 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ba4d80d commit cd301d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/wp-includes/block-supports/block-visibility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
function wp_render_block_visibility_support( $block_content, $block ) {
2020
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
2121

22-
if ( ! $block_type || ! block_has_support( $block_type, 'blockVisibility', true ) ) {
22+
if ( ! $block_type || ! block_has_support( $block_type, 'visibility', true ) ) {
2323
return $block_content;
2424
}
2525

tests/phpunit/tests/block-supports/block-visibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function register_visibility_block_with_support( $block_name, $supports
6363
public function test_block_visibility_support_hides_block_when_visibility_false() {
6464
$block_type = $this->register_visibility_block_with_support(
6565
'test/visibility-block',
66-
array( 'blockVisibility' => true )
66+
array( 'visibility' => true )
6767
);
6868

6969
$block_content = '<p>This is a test block.</p>';
@@ -90,7 +90,7 @@ public function test_block_visibility_support_hides_block_when_visibility_false(
9090
public function test_block_visibility_support_shows_block_when_support_not_opted_in() {
9191
$block_type = $this->register_visibility_block_with_support(
9292
'test/visibility-block',
93-
array( 'blockVisibility' => false )
93+
array( 'visibility' => false )
9494
);
9595

9696
$block_content = '<p>This is a test block.</p>';

0 commit comments

Comments
 (0)