<?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 );
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| align.php | 2026-02-23 19:41 | 1.67 KB | 76129f60960:kunden | -xw-x----- | |
| aria-label.php | 2026-02-23 19:41 | 1.57 KB | 76129f60960:kunden | -xw-x----- | |
| background.php | 2026-02-23 19:41 | 4.05 KB | 76129f60960:kunden | -xw-x----- | |
| block-style-variations.php | 2026-02-23 19:41 | 9.2 KB | 76129f60960:kunden | -xw-x----- | |
| block-visibility.php | 2026-02-23 19:41 | 854 B | 76129f60960:kunden | -xw-x----- | |
| border.php | 2026-02-23 19:41 | 6.27 KB | 76129f60960:kunden | -xw-x----- | |
| colors.php | 2026-02-23 19:41 | 5.81 KB | 76129f60960:kunden | -xw-x----- | |
| custom-classname.php | 2026-02-23 19:41 | 1.64 KB | 76129f60960:kunden | -xw-x----- | |
| dimensions.php | 2026-02-23 19:41 | 5.28 KB | 76129f60960:kunden | -xw-x----- | |
| duotone.php | 2026-02-23 19:41 | 2.67 KB | 76129f60960:kunden | -xw-x----- | |
| elements.php | 2026-02-23 19:41 | 8.46 KB | 76129f60960:kunden | -xw-x----- | |
| generated-classname.php | 2026-02-23 19:41 | 1.7 KB | 76129f60960:kunden | -xw-x----- | |
| layout.php | 2026-02-23 19:41 | 39 KB | 76129f60960:kunden | -xw-x----- | |
| position.php | 2026-02-23 19:41 | 4.24 KB | 76129f60960:kunden | -xw-x----- | |
| settings.php | 2026-02-23 19:41 | 4.52 KB | 76129f60960:kunden | -xw-x----- | |
| shadow.php | 2026-02-23 19:41 | 2.04 KB | 76129f60960:kunden | -xw-x----- | |
| spacing.php | 2026-02-23 19:41 | 2.81 KB | 76129f60960:kunden | -xw-x----- | |
| typography.php | 2026-02-23 19:41 | 29.08 KB | 76129f60960:kunden | -xw-x----- | |
| utils.php | 2026-02-23 19:41 | 1011 B | 76129f60960:kunden | -xw-x----- | |