<?php
/**
 * Auto-generated from WordPress/gutenberg lib/block-supports/block-visibility.php
 * Commit: 5f84bafdec1bed05247c1080c12f6a237951b862
 * DO NOT EDIT — managed by scripts/sync-block-supports.js
 */

/**
 * Render nothing if the block is hidden.
 *
 * @param string $block_content Rendered block content.
 * @param array  $block         Block object.
 * @return string Filtered block content.
 */
function gutenberg_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;
}
