PATH:
home
/
beestk
/
autocaz
/
wp-includes
<?php /** * Block support flags. * * @package WordPress * * @since 5.6.0 */ /** * Class encapsulating and implementing Block Supports. * * @since 5.6.0 * * @access private */ #[AllowDynamicProperties] class WP_Block_Supports { /** * Config. * * @since 5.6.0 * @var array */ private $block_supports = array(); /** * Tracks the current block to be rendered. * * @since 5.6.0 * @var array */ public static $block_to_render = null; /** * Container for the main instance of the class. * * @since 5.6.0 * @var WP_Block_Supports|null */ private static $instance = null; /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.6.0 * * @return WP_Block_Supports The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Initializes the block supports. It registers the block supports block attributes. * * @since 5.6.0 */ public static function init() { $instance = self::get_instance(); $instance->register_attributes(); } /** * Registers a block support. * * @since 5.6.0 * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ * * @param string $block_support_name Block support name. * @param array $block_support_config Array containing the properties of the block support. */ public function register( $block_support_name, $block_support_config ) { $this->block_supports[ $block_support_name ] = array_merge( $block_support_config, array( 'name' => $block_support_name ) ); } /** * Generates an array of HTML attributes, such as classes, by applying to * the given block all of the features that the block supports. * * @since 5.6.0 * * @return string[] Array of HTML attribute values keyed by their name. */ public function apply_block_supports() { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( self::$block_to_render['blockName'] ); // If no render_callback, assume styles have been previously handled. if ( ! $block_type || empty( $block_type ) ) { return array(); } $block_attributes = array_key_exists( 'attrs', self::$block_to_render ) ? self::$block_to_render['attrs'] : array(); $output = array(); foreach ( $this->block_supports as $block_support_config ) { if ( ! isset( $block_support_config['apply'] ) ) { continue; } $new_attributes = call_user_func( $block_support_config['apply'], $block_type, $block_attributes ); if ( ! empty( $new_attributes ) ) { foreach ( $new_attributes as $attribute_name => $attribute_value ) { if ( empty( $output[ $attribute_name ] ) ) { $output[ $attribute_name ] = $attribute_value; } else { $output[ $attribute_name ] .= " $attribute_value"; } } } } return $output; } /** * Registers the block attributes required by the different block supports. * * @since 5.6.0 */ private function register_attributes() { $block_registry = WP_Block_Type_Registry::get_instance(); $registered_block_types = $block_registry->get_all_registered(); foreach ( $registered_block_types as $block_type ) { if ( ! ( $block_type instanceof WP_Block_Type ) ) { continue; } if ( ! $block_type->attributes ) { $block_type->attributes = array(); } foreach ( $this->block_supports as $block_support_config ) { if ( ! isset( $block_support_config['register_attribute'] ) ) { continue; } call_user_func( $block_support_config['register_attribute'], $block_type ); } } } } /** * Generates a string of attributes by applying to the current block being * rendered all of the features that the block supports. * * @since 5.6.0 * * @param string[] $extra_attributes Optional. Array of extra attributes to render on the block wrapper. * @return string String of HTML attributes. */ function get_block_wrapper_attributes( $extra_attributes = array() ) { $new_attributes = WP_Block_Supports::get_instance()->apply_block_supports(); if ( empty( $new_attributes ) && empty( $extra_attributes ) ) { return ''; } // This is hardcoded on purpose. // We only support a fixed list of attributes. $attributes_to_merge = array( 'style', 'class', 'id' ); $attributes = array(); foreach ( $attributes_to_merge as $attribute_name ) { if ( empty( $new_attributes[ $attribute_name ] ) && empty( $extra_attributes[ $attribute_name ] ) ) { continue; } if ( empty( $new_attributes[ $attribute_name ] ) ) { $attributes[ $attribute_name ] = $extra_attributes[ $attribute_name ]; continue; } if ( empty( $extra_attributes[ $attribute_name ] ) ) { $attributes[ $attribute_name ] = $new_attributes[ $attribute_name ]; continue; } $attributes[ $attribute_name ] = $extra_attributes[ $attribute_name ] . ' ' . $new_attributes[ $attribute_name ]; } foreach ( $extra_attributes as $attribute_name => $value ) { if ( ! in_array( $attribute_name, $attributes_to_merge, true ) ) { $attributes[ $attribute_name ] = $value; } } if ( empty( $attributes ) ) { return ''; } $normalized_attributes = array(); foreach ( $attributes as $key => $value ) { $normalized_attributes[] = $key . '="' . esc_attr( $value ) . '"'; } return implode( ' ', $normalized_attributes ); }
[+]
..
[-] class-wp-http-proxy.php
[open]
[-] template.php
[open]
[+]
fonts
[-] vars.php
[open]
[-] l10n.php
[open]
[-] load.php
[open]
[-] class-wp-block-pattern-categories-registry.php
[open]
[-] class-wp-network.php
[open]
[-] capabilities.php
[open]
[-] class-wp-image-editor-imagick.php
[open]
[+]
sodium_compat
[-] class-wp-post.php
[open]
[+]
theme-compat
[-] block-editor.php
[open]
[-] class-wp-image-editor-gd.php
[open]
[-] template-canvas.php
[open]
[-] class-smtp.php
[open]
[-] class-wp-block-styles-registry.php
[open]
[-] class-wp-http-requests-response.php
[open]
[-] class-wp-widget-factory.php
[open]
[-] class-wp-http.php
[open]
[-] class-wp-theme-json.php
[open]
[-] feed-rdf.php
[open]
[-] class-wp-tax-query.php
[open]
[-] class-wp-role.php
[open]
[-] block-template-utils.php
[open]
[-] global-styles-and-settings.php
[open]
[-] class-phpass.php
[open]
[-] class-wp-site-query.php
[open]
[+]
IXR
[-] class-walker-comment.php
[open]
[-] class-wp-http-encoding.php
[open]
[-] class-wp-session-tokens.php
[open]
[-] sitemaps.php
[open]
[-] admin-bar.php
[open]
[-] class-wp-xmlrpc-server.php
[open]
[-] class-wp.php
[open]
[-] theme.php
[open]
[-] class-wp-post-type.php
[open]
[-] atomlib.php
[open]
[-] class-wp-theme-json-schema.php
[open]
[+]
sitemaps
[-] class.wp-dependencies.php
[open]
[-] rss.php
[open]
[-] registration.php
[open]
[-] taxonomy.php
[open]
[+]
style-engine
[-] shortcodes.php
[open]
[-] class-wp-http-ixr-client.php
[open]
[-] wp-diff.php
[open]
[-] class-wp-list-util.php
[open]
[-] class-walker-page-dropdown.php
[open]
[-] query.php
[open]
[-] session.php
[open]
[-] error-protection.php
[open]
[-] widgets.php
[open]
[-] class-wp-block-patterns-registry.php
[open]
[-] class-wp-http-cookie.php
[open]
[-] class-wp-duotone.php
[open]
[-] class-pop3.php
[open]
[-] class-wp-block-parser-block.php
[open]
[-] class-wp-date-query.php
[open]
[-] ms-blogs.php
[open]
[-] theme.json
[open]
[-] class-wp-recovery-mode-cookie-service.php
[open]
[-] compat.php
[open]
[-] class-wp-term.php
[open]
[-] embed.php
[open]
[-] class-wp-feed-cache.php
[open]
[-] post.php
[open]
[-] class.wp-scripts.php
[open]
[-] class-wp-text-diff-renderer-inline.php
[open]
[-] deprecated.php
[open]
[-] class-wp-image-editor.php
[open]
[-] default-filters.php
[open]
[-] class-wp-oembed-controller.php
[open]
[-] feed-rss2-comments.php
[open]
[-] ms-default-constants.php
[open]
[-] class-json.php
[open]
[-] post-formats.php
[open]
[-] category.php
[open]
[-] general-template.php
[open]
[-] revision.php
[open]
[-] pluggable.php
[open]
[+]
assets
[-] class-wp-meta-query.php
[open]
[-] class-wp-network-query.php
[open]
[+]
blocks
[-] registration-functions.php
[open]
[-] class-wp-locale-switcher.php
[open]
[-] post-thumbnail-template.php
[open]
[-] post-template.php
[open]
[-] ms-network.php
[open]
[-] http.php
[open]
[-] fonts.php
[open]
[-] class-walker-nav-menu.php
[open]
[-] ms-load.php
[open]
[-] default-widgets.php
[open]
[-] class-wp-taxonomy.php
[open]
[-] class-wp-simplepie-sanitize-kses.php
[open]
[-] class-IXR.php
[open]
[-] class-wp-term-query.php
[open]
[-] class-wp-block-type-registry.php
[open]
[-] class-wp-oembed.php
[open]
[+]
js
[-] theme-templates.php
[open]
[-] bookmark.php
[open]
[-] class-wp-widget.php
[open]
[-] plugin.php
[open]
[+]
widgets
[+]
rest-api
[-] class-wp-customize-section.php
[open]
[-] block-i18n.json
[open]
[-] feed.php
[open]
[-] class-wp-http-response.php
[open]
[-] ms-site.php
[open]
[-] class-wp-http-requests-hooks.php
[open]
[+]
Requests
[-] ms-files.php
[open]
[-] version.php
[open]
[-] class-wp-theme-json-resolver.php
[open]
[-] class-wp-block-list.php
[open]
[+]
pomo
[-] class-wp-fatal-error-handler.php
[open]
[-] functions.php
[open]
[-] class-simplepie.php
[open]
[-] class-wp-site.php
[open]
[-] ms-default-filters.php
[open]
[-] class-wp-block.php
[open]
[-] class-wp-customize-nav-menus.php
[open]
[-] template-loader.php
[open]
[-] option.php
[open]
[-] cache.php
[open]
[-] class-wp-ajax-response.php
[open]
[-] cache-compat.php
[open]
[+]
SimplePie
[-] theme-previews.php
[open]
[-] class-wp-block-supports.php
[open]
[-] pluggable-deprecated.php
[open]
[-] class-walker-category-dropdown.php
[open]
[-] rewrite.php
[open]
[-] class.wp-styles.php
[open]
[-] category-template.php
[open]
[-] class-wp-dependencies.php
[open]
[-] class-wp-recovery-mode-key-service.php
[open]
[-] meta.php
[open]
[-] blocks.php
[open]
[-] nav-menu-template.php
[open]
[-] https-detection.php
[open]
[-] class-wp-block-editor-context.php
[open]
[+]
certificates
[-] cron.php
[open]
[-] feed-atom-comments.php
[open]
[-] block-patterns.php
[open]
[-] class-wp-block-type.php
[open]
[-] class-wp-application-passwords.php
[open]
[-] class-wp-textdomain-registry.php
[open]
[-] media.php
[open]
[-] class-wp-metadata-lazyloader.php
[open]
[-] class-wp-styles.php
[open]
[-] robots-template.php
[open]
[-] feed-atom.php
[open]
[-] comment.php
[open]
[-] class-wp-http-curl.php
[open]
[-] user.php
[open]
[-] kses.php
[open]
[-] spl-autoload-compat.php
[open]
[+]
html-api
[-] class-wp-text-diff-renderer-table.php
[open]
[-] class-wp-feed-cache-transient.php
[open]
[-] class-snoopy.php
[open]
[-] class-wp-error.php
[open]
[-] locale.php
[open]
[-] class-wp-block-parser-frame.php
[open]
[-] class-wp-embed.php
[open]
[-] class-wp-comment-query.php
[open]
[-] nav-menu.php
[open]
[-] wp-db.php
[open]
[-] class-wp-recovery-mode-email-service.php
[open]
[+]
images
[-] date.php
[open]
[-] ms-settings.php
[open]
[+]
block-patterns
[-] rest-api.php
[open]
[-] class-requests.php
[open]
[-] class-wp-object-cache.php
[open]
[-] class-wp-recovery-mode-link-service.php
[open]
[-] class-wp-customize-setting.php
[open]
[-] class-wp-matchesmapregex.php
[open]
[-] class-wp-hook.php
[open]
[-] class-wp-walker.php
[open]
[-] class-walker-category.php
[open]
[-] class-wp-editor.php
[open]
[-] class-wp-recovery-mode.php
[open]
[-] class-wpdb.php
[open]
[-] class-wp-admin-bar.php
[open]
[-] class-wp-user-request.php
[open]
[-] class-wp-dependency.php
[open]
[-] class-wp-http-streams.php
[open]
[-] class-wp-customize-manager.php
[open]
[-] feed-rss2.php
[open]
[-] class-wp-navigation-fallback.php
[open]
[+]
customize
[-] class-wp-user-meta-session-tokens.php
[open]
[-] class-wp-roles.php
[open]
[-] media-template.php
[open]
[+]
ID3
[-] class-wp-theme.php
[open]
[-] class-wp-classic-to-block-menu-converter.php
[open]
[-] class-wp-scripts.php
[open]
[-] class-oembed.php
[open]
[-] class-wp-customize-panel.php
[open]
[-] functions.wp-scripts.php
[open]
[-] rss-functions.php
[open]
[-] class-wp-paused-extensions-storage.php
[open]
[-] class-feed.php
[open]
[-] class-wp-comment.php
[open]
[-] class-wp-user-query.php
[open]
[-] class-wp-user.php
[open]
[-] class-wp-customize-control.php
[open]
[-] functions.wp-styles.php
[open]
[-] class-phpmailer.php
[open]
[-] script-loader.php
[open]
[-] class-wp-block-template.php
[open]
[-] author-template.php
[open]
[-] ms-deprecated.php
[open]
[+]
css
[-] canonical.php
[open]
[-] class-wp-rewrite.php
[open]
[-] class-wp-block-parser.php
[open]
[-] class-wp-query.php
[open]
[-] class-walker-page.php
[open]
[-] bookmark-template.php
[open]
[-] class-wp-customize-widgets.php
[open]
[-] class-wp-locale.php
[open]
[+]
PHPMailer
[-] block-template.php
[open]
[-] theme-i18n.json
[open]
[-] embed-template.php
[open]
[-] feed-rss.php
[open]
[-] formatting.php
[open]
[-] update.php
[open]
[-] class-wp-simplepie-file.php
[open]
[-] link-template.php
[open]
[-] https-migration.php
[open]
[+]
php-compat
[-] comment-template.php
[open]
[-] style-engine.php
[open]
[+]
Text
[+]
block-supports
[-] class-http.php
[open]
[-] class-wp-theme-json-data.php
[open]
[-] ms-functions.php
[open]
[-] default-constants.php
[open]