wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_render_block_visibility_support is private and should not be used in themes or plugins directly.
wp_render_block_visibility_support › WordPress Function
Since6.9.0
Deprecatedn/a
› wp_render_block_visibility_support ( $block_content, $block )
| Access: |
|
| Parameters: (2) |
|
| Returns: |
|
| Defined at: | |
| Codex: |
Render nothing if the block is hidden.
Source
function wp_render_block_visibility_support( $block_content, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
if ( ! $block_type || ! block_has_support( $block_type, 'blockVisibility', true ) ) {
return $block_content;
}
if ( isset( $block['attrs']['metadata']['blockVisibility'] ) && false === $block['attrs']['metadata']['blockVisibility'] ) {
return '';
}
return $block_content;
}