Редактор файлов и навигация
Текущая папка: //wp-includes
Содержимое
.. назад
[DIR]
ID3
[DIR]
IXR
[DIR]
PHPMailer
[DIR]
Requests
[DIR]
SimplePie
[DIR]
Text
[DIR]
abilities-api
[FILE]
abilities-api.php
[FILE]
abilities.php
[FILE]
admin-bar.php
[DIR]
assets
[FILE]
atomlib.php
[FILE]
author-template.php
[DIR]
block-bindings
[FILE]
block-bindings.php
[FILE]
block-editor.php
[FILE]
block-i18n.json
[DIR]
block-patterns
[FILE]
block-patterns.php
[DIR]
block-supports
[FILE]
block-template-utils.php
[FILE]
block-template.php
[DIR]
blocks
[FILE]
blocks.php
[FILE]
bookmark-template.php
[FILE]
bookmark.php
[FILE]
cache-compat.php
[FILE]
cache.php
[FILE]
canonical.php
[FILE]
capabilities.php
[FILE]
category-template.php
[FILE]
category.php
[DIR]
certificates
[FILE]
class-IXR.php
[FILE]
class-avif-info.php
[FILE]
class-feed.php
[FILE]
class-http.php
[FILE]
class-json.php
[FILE]
class-oembed.php
[FILE]
class-phpass.php
[FILE]
class-phpmailer.php
[FILE]
class-pop3.php
[FILE]
class-requests.php
[FILE]
class-simplepie.php
[FILE]
class-smtp.php
[FILE]
class-snoopy.php
[FILE]
class-walker-category-dropdown.php
[FILE]
class-walker-category.php
[FILE]
class-walker-comment.php
[FILE]
class-walker-nav-menu.php
[FILE]
class-walker-page-dropdown.php
[FILE]
class-walker-page.php
[FILE]
class-wp-admin-bar.php
[FILE]
class-wp-ajax-response.php
[FILE]
class-wp-application-passwords.php
[FILE]
class-wp-block-bindings-registry.php
[FILE]
class-wp-block-bindings-source.php
[FILE]
class-wp-block-editor-context.php
[FILE]
class-wp-block-list.php
[FILE]
class-wp-block-metadata-registry.php
[FILE]
class-wp-block-parser-block.php
[FILE]
class-wp-block-parser-frame.php
[FILE]
class-wp-block-parser.php
[FILE]
class-wp-block-pattern-categories-registry.php
[FILE]
class-wp-block-patterns-registry.php
[FILE]
class-wp-block-processor.php
[FILE]
class-wp-block-styles-registry.php
[FILE]
class-wp-block-supports.php
[FILE]
class-wp-block-template.php
[FILE]
class-wp-block-templates-registry.php
[FILE]
class-wp-block-type-registry.php
[FILE]
class-wp-block-type.php
[FILE]
class-wp-block.php
[FILE]
class-wp-classic-to-block-menu-converter.php
[FILE]
class-wp-comment-query.php
[FILE]
class-wp-comment.php
[FILE]
class-wp-customize-control.php
[FILE]
class-wp-customize-manager.php
[FILE]
class-wp-customize-nav-menus.php
[FILE]
class-wp-customize-panel.php
[FILE]
class-wp-customize-section.php
[FILE]
class-wp-customize-setting.php
[FILE]
class-wp-customize-widgets.php
[FILE]
class-wp-date-query.php
[FILE]
class-wp-dependencies.php
[FILE]
class-wp-dependency.php
[FILE]
class-wp-duotone.php
[FILE]
class-wp-editor.php
[FILE]
class-wp-embed.php
[FILE]
class-wp-error.php
[FILE]
class-wp-exception.php
[FILE]
class-wp-fatal-error-handler.php
[FILE]
class-wp-feed-cache-transient.php
[FILE]
class-wp-feed-cache.php
[FILE]
class-wp-hook.php
[FILE]
class-wp-http-cookie.php
[FILE]
class-wp-http-curl.php
[FILE]
class-wp-http-encoding.php
[FILE]
class-wp-http-ixr-client.php
[FILE]
class-wp-http-proxy.php
[FILE]
class-wp-http-requests-hooks.php
[FILE]
class-wp-http-requests-response.php
[FILE]
class-wp-http-response.php
[FILE]
class-wp-http-streams.php
[FILE]
class-wp-http.php
[FILE]
class-wp-image-editor-gd.php
[FILE]
class-wp-image-editor-imagick.php
[FILE]
class-wp-image-editor.php
[FILE]
class-wp-list-util.php
[FILE]
class-wp-locale-switcher.php
[FILE]
class-wp-locale.php
[FILE]
class-wp-matchesmapregex.php
[FILE]
class-wp-meta-query.php
[FILE]
class-wp-metadata-lazyloader.php
[FILE]
class-wp-navigation-fallback.php
[FILE]
class-wp-network-query.php
[FILE]
class-wp-network.php
[FILE]
class-wp-object-cache.php
[FILE]
class-wp-oembed-controller.php
[FILE]
class-wp-oembed.php
[FILE]
class-wp-paused-extensions-storage.php
[FILE]
class-wp-phpmailer.php
[FILE]
class-wp-plugin-dependencies.php
[FILE]
class-wp-post-type.php
[FILE]
class-wp-post.php
[FILE]
class-wp-query.php
[FILE]
class-wp-recovery-mode-cookie-service.php
[FILE]
class-wp-recovery-mode-email-service.php
[FILE]
class-wp-recovery-mode-key-service.php
[FILE]
class-wp-recovery-mode-link-service.php
[FILE]
class-wp-recovery-mode.php
[FILE]
class-wp-rewrite.php
[FILE]
class-wp-role.php
[FILE]
class-wp-roles.php
[FILE]
class-wp-script-modules.php
[FILE]
class-wp-scripts.php
[FILE]
class-wp-session-tokens.php
[FILE]
class-wp-simplepie-file.php
[FILE]
class-wp-simplepie-sanitize-kses.php
[FILE]
class-wp-site-query.php
[FILE]
class-wp-site.php
[FILE]
class-wp-speculation-rules.php
[FILE]
class-wp-styles.php
[FILE]
class-wp-tax-query.php
[FILE]
class-wp-taxonomy.php
[FILE]
class-wp-term-query.php
[FILE]
class-wp-term.php
[FILE]
class-wp-text-diff-renderer-inline.php
[FILE]
class-wp-text-diff-renderer-table.php
[FILE]
class-wp-textdomain-registry.php
[FILE]
class-wp-theme-json-data.php
[FILE]
class-wp-theme-json-resolver.php
[FILE]
class-wp-theme-json-schema.php
[FILE]
class-wp-theme-json.php
[FILE]
class-wp-theme.php
[FILE]
class-wp-token-map.php
[FILE]
class-wp-url-pattern-prefixer.php
[FILE]
class-wp-user-meta-session-tokens.php
[FILE]
class-wp-user-query.php
[FILE]
class-wp-user-request.php
[FILE]
class-wp-user.php
[FILE]
class-wp-walker.php
[FILE]
class-wp-widget-factory.php
[FILE]
class-wp-widget.php
[FILE]
class-wp-xmlrpc-server.php
[FILE]
class-wp.php
[FILE]
class-wpdb.php
[FILE]
class.wp-dependencies.php
[FILE]
class.wp-scripts.php
[FILE]
class.wp-styles.php
[FILE]
comment-template.php
[FILE]
comment.php
[FILE]
compat-utf8.php
[FILE]
compat.php
[FILE]
cron.php
[DIR]
css
[DIR]
customize
[FILE]
date.php
[FILE]
default-constants.php
[FILE]
default-filters.php
[FILE]
default-widgets.php
[FILE]
deprecated.php
[FILE]
embed-template.php
[FILE]
embed.php
[FILE]
error-protection.php
[FILE]
feed-atom-comments.php
[FILE]
feed-atom.php
[FILE]
feed-rdf.php
[FILE]
feed-rss.php
[FILE]
feed-rss2-comments.php
[FILE]
feed-rss2.php
[FILE]
feed.php
[DIR]
fonts
[FILE]
fonts.php
[FILE]
formatting.php
[FILE]
functions.php
[FILE]
functions.wp-scripts.php
[FILE]
functions.wp-styles.php
[FILE]
general-template.php
[FILE]
global-styles-and-settings.php
[DIR]
html-api
[FILE]
http.php
[FILE]
https-detection.php
[FILE]
https-migration.php
[DIR]
images
[DIR]
interactivity-api
[DIR]
js
[FILE]
kses.php
[DIR]
l10n
[FILE]
l10n.php
[FILE]
link-template.php
[FILE]
load.php
[FILE]
locale.php
[FILE]
media-template.php
[FILE]
media.php
[FILE]
meta.php
[FILE]
ms-blogs.php
[FILE]
ms-default-constants.php
[FILE]
ms-default-filters.php
[FILE]
ms-deprecated.php
[FILE]
ms-files.php
[FILE]
ms-functions.php
[FILE]
ms-load.php
[FILE]
ms-network.php
[FILE]
ms-settings.php
[FILE]
ms-site.php
[FILE]
nav-menu-template.php
[FILE]
nav-menu.php
[FILE]
option.php
[DIR]
php-compat
[FILE]
pluggable-deprecated.php
[FILE]
pluggable.php
[FILE]
plugin.php
[DIR]
pomo
[FILE]
post-formats.php
[FILE]
post-template.php
[FILE]
post-thumbnail-template.php
[FILE]
post.php
[FILE]
query.php
[FILE]
registration-functions.php
[FILE]
registration.php
[DIR]
rest-api
[FILE]
rest-api.php
[FILE]
revision.php
[FILE]
rewrite.php
[FILE]
robots-template.php
[FILE]
rss-functions.php
[FILE]
rss.php
[FILE]
script-loader.php
[FILE]
script-modules.php
[FILE]
session.php
[FILE]
shortcodes.php
[DIR]
sitemaps
[FILE]
sitemaps.php
[DIR]
sodium_compat
[FILE]
speculative-loading.php
[FILE]
spl-autoload-compat.php
[DIR]
style-engine
[FILE]
style-engine.php
[FILE]
taxonomy.php
[FILE]
template-canvas.php
[FILE]
template-loader.php
[FILE]
template.php
[DIR]
theme-compat
[FILE]
theme-i18n.json
[FILE]
theme-previews.php
[FILE]
theme-templates.php
[FILE]
theme.json
[FILE]
theme.php
[FILE]
update.php
[FILE]
user.php
[FILE]
utf8.php
[FILE]
vars.php
[FILE]
version.php
[DIR]
widgets
[FILE]
widgets.php
[FILE]
wp-db.php
[FILE]
wp-diff.php
Редактирование: block-bindings.php
<?php /** * Block Bindings API * * Contains functions for managing block bindings in WordPress. * * @package WordPress * @subpackage Block Bindings * @since 6.5.0 */ /** * Registers a new block bindings source. * * Registering a source consists of defining a **name** for that source and a callback function specifying * how to get a value from that source and pass it to a block attribute. * * Once a source is registered, any block that supports the Block Bindings API can use a value * from that source by setting its `metadata.bindings` attribute to a value that refers to the source. * * Note that `register_block_bindings_source()` should be called from a handler attached to the `init` hook. * * * ## Example * * ### Registering a source * * First, you need to define a function that will be used to get the value from the source. * * function my_plugin_get_custom_source_value( array $source_args, $block_instance, string $attribute_name ) { * // Your custom logic to get the value from the source. * // For example, you can use the `$source_args` to look up a value in a custom table or get it from an external API. * $value = $source_args['key']; * * return "The value passed to the block is: $value" * } * * The `$source_args` will contain the arguments passed to the source in the block's * `metadata.bindings` attribute. See the example in the "Usage in a block" section below. * * function my_plugin_register_block_bindings_sources() { * register_block_bindings_source( 'my-plugin/my-custom-source', array( * 'label' => __( 'My Custom Source', 'my-plugin' ), * 'get_value_callback' => 'my_plugin_get_custom_source_value', * ) ); * } * add_action( 'init', 'my_plugin_register_block_bindings_sources' ); * * ### Usage in a block * * In a block's `metadata.bindings` attribute, you can specify the source and * its arguments. Such a block will use the source to override the block * attribute's value. For example: * * <!-- wp:paragraph { * "metadata": { * "bindings": { * "content": { * "source": "my-plugin/my-custom-source", * "args": { * "key": "you can pass any custom arguments here" * } * } * } * } * } --> * <p>Fallback text that gets replaced.</p> * <!-- /wp:paragraph --> * * @since 6.5.0 * * @param string $source_name The name of the source. It must be a string containing a namespace prefix, i.e. * `my-plugin/my-custom-source`. It must only contain lowercase alphanumeric * characters, the forward slash `/` and dashes. * @param array $source_properties { * The array of arguments that are used to register a source. * * @type string $label The label of the source. * @type callable $get_value_callback A callback executed when the source is processed during block rendering. * The callback should have the following signature: * * `function( $source_args, $block_instance, $attribute_name ): mixed` * - @param array $source_args Array containing source arguments * used to look up the override value, * i.e. {"key": "foo"}. * - @param WP_Block $block_instance The block instance. * - @param string $attribute_name The name of an attribute. * The callback has a mixed return type; it may return a string to override * the block's original value, null, false to remove an attribute, etc. * @type string[] $uses_context Optional. Array of values to add to block `uses_context` needed by the source. * } * @return WP_Block_Bindings_Source|false Source when the registration was successful, or `false` on failure. */ function register_block_bindings_source( string $source_name, array $source_properties ) { return WP_Block_Bindings_Registry::get_instance()->register( $source_name, $source_properties ); } /** * Unregisters a block bindings source. * * @since 6.5.0 * * @param string $source_name Block bindings source name including namespace. * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise. */ function unregister_block_bindings_source( string $source_name ) { return WP_Block_Bindings_Registry::get_instance()->unregister( $source_name ); } /** * Retrieves the list of all registered block bindings sources. * * @since 6.5.0 * * @return WP_Block_Bindings_Source[] The array of registered block bindings sources. */ function get_all_registered_block_bindings_sources() { return WP_Block_Bindings_Registry::get_instance()->get_all_registered(); } /** * Retrieves a registered block bindings source. * * @since 6.5.0 * * @param string $source_name The name of the source. * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered. */ function get_block_bindings_source( string $source_name ) { return WP_Block_Bindings_Registry::get_instance()->get_registered( $source_name ); } /** * Retrieves the list of block attributes supported by block bindings. * * @since 6.9.0 * * @param string $block_type The block type whose supported attributes are being retrieved. * @return array The list of block attributes that are supported by block bindings. */ function get_block_bindings_supported_attributes( $block_type ) { $block_bindings_supported_attributes = array( 'core/paragraph' => array( 'content' ), 'core/heading' => array( 'content' ), 'core/image' => array( 'id', 'url', 'title', 'alt', 'caption' ), 'core/button' => array( 'url', 'text', 'linkTarget', 'rel' ), 'core/post-date' => array( 'datetime' ), 'core/navigation-link' => array( 'url' ), 'core/navigation-submenu' => array( 'url' ), ); $supported_block_attributes = isset( $block_type, $block_bindings_supported_attributes[ $block_type ] ) ? $block_bindings_supported_attributes[ $block_type ] : array(); /** * Filters the supported block attributes for block bindings. * * @since 6.9.0 * * @param string[] $supported_block_attributes The block's attributes that are supported by block bindings. * @param string $block_type The block type whose attributes are being filtered. */ $supported_block_attributes = apply_filters( 'block_bindings_supported_attributes', $supported_block_attributes, $block_type ); /** * Filters the supported block attributes for block bindings. * * The dynamic portion of the hook name, `$block_type`, refers to the block type * whose attributes are being filtered. * * @since 6.9.0 * * @param string[] $supported_block_attributes The block's attributes that are supported by block bindings. */ $supported_block_attributes = apply_filters( "block_bindings_supported_attributes_{$block_type}", $supported_block_attributes ); return $supported_block_attributes; }
Сохранить
Переименовать файл
Переименовать
Изменить права доступа
Текущие права:
0644
(644)
Изменить права
Удалить файл
Удалить файл