HEX
Server: Apache
System: Linux cpanel2.adamant.ua 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64
User: artistss (1300)
PHP: 7.2.34
Disabled: dl,exec,passthru,pcntl_exec,posix_kill,posix_mkfifo,posix_setuid,proc_close,proc_terminate,shell_exec,system,ftp_exec,leak,posix_setpgid,posix_setsid,proc_get_status,proc_nice,show_source,set_time_limit,openlog,syslog,closelog,exec,passthru,system,shell_exec
Upload Files
File: /home/artistss/psychotherapist-tyshchenko.com.ua/wp-includes/block-supports/block-visibility.php
<?php
/**
 * Block visibility block support flag.
 *
 * @package WordPress
 * @since 6.9.0
 */

/**
 * Render nothing if the block is hidden.
 *
 * @since 6.9.0
 * @access private
 *
 * @param string $block_content Rendered block content.
 * @param array  $block         Block object.
 * @return string Filtered block content.
 */
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, 'visibility', true ) ) {
		return $block_content;
	}

	if ( isset( $block['attrs']['metadata']['blockVisibility'] ) && false === $block['attrs']['metadata']['blockVisibility'] ) {
		return '';
	}

	return $block_content;
}

add_filter( 'render_block', 'wp_render_block_visibility_support', 10, 2 );