From 86e8753e89d59849276dcdd91b9a7dd78bb4abe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 17 Jul 2024 08:50:38 +0000 Subject: [PATCH] Generate stubs for WordPress 6.6.0 --- source/composer.json | 2 +- wordpress-stubs.php | 3696 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 3052 insertions(+), 646 deletions(-) diff --git a/source/composer.json b/source/composer.json index 7969fe55..f478f8a8 100644 --- a/source/composer.json +++ b/source/composer.json @@ -7,7 +7,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "johnpbloch/wordpress": "6.5.5" + "johnpbloch/wordpress": "6.6.0" }, "minimum-stability": "stable", "config": { diff --git a/wordpress-stubs.php b/wordpress-stubs.php index e5a04fcd..31d3ff41 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -26,7 +26,6 @@ class WP_Upgrader_Skin * Holds the upgrader data. * * @since 2.8.0 - * * @var WP_Upgrader */ public $upgrader; @@ -34,7 +33,6 @@ class WP_Upgrader_Skin * Whether header is done. * * @since 2.8.0 - * * @var bool */ public $done_header = \false; @@ -42,7 +40,6 @@ class WP_Upgrader_Skin * Whether footer is done. * * @since 2.8.0 - * * @var bool */ public $done_footer = \false; @@ -50,7 +47,6 @@ class WP_Upgrader_Skin * Holds the result of an upgrade. * * @since 2.8.0 - * * @var string|bool|WP_Error */ public $result = \false; @@ -58,7 +54,6 @@ class WP_Upgrader_Skin * Holds the options of an upgrade. * * @since 2.8.0 - * * @var array */ public $options = array(); @@ -76,6 +71,8 @@ public function __construct($args = array()) { } /** + * Sets the relationship between the skin being used and the upgrader. + * * @since 2.8.0 * * @param WP_Upgrader $upgrader @@ -84,6 +81,8 @@ public function set_upgrader(&$upgrader) { } /** + * Sets up the strings used in the update process. + * * @since 3.0.0 */ public function add_strings() @@ -119,6 +118,8 @@ public function request_filesystem_credentials($error = \false, $context = '', $ { } /** + * Displays the header before the update process. + * * @since 2.8.0 * @phpstan-return void */ @@ -126,6 +127,8 @@ public function header() { } /** + * Displays the footer following the update process. + * * @since 2.8.0 * @phpstan-return void */ @@ -133,6 +136,8 @@ public function footer() { } /** + * Displays an error message about the update. + * * @since 2.8.0 * * @param string|WP_Error $errors Errors. @@ -141,6 +146,8 @@ public function error($errors) { } /** + * Displays a message about the update. + * * @since 2.8.0 * @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support. * @@ -160,7 +167,7 @@ public function before() { } /** - * Performs and action following an update. + * Performs an action following an update. * * @since 2.8.0 */ @@ -180,12 +187,16 @@ protected function decrement_update_count($type) { } /** + * Displays the header before the bulk update process. + * * @since 3.0.0 */ public function bulk_header() { } /** + * Displays the footer following the bulk update process. + * * @since 3.0.0 */ public function bulk_footer() @@ -300,23 +311,44 @@ public function footer() */ class Bulk_Upgrader_Skin extends \WP_Upgrader_Skin { + /** + * Whether the bulk update process has started. + * + * @since 3.0.0 + * @var bool + */ public $in_loop = \false; /** + * Stores an error message about the update. + * + * @since 3.0.0 * @var string|false */ public $error = \false; /** + * Constructor. + * + * Sets up the generic skin for the Bulk Upgrader classes. + * + * @since 3.0.0 + * * @param array $args */ public function __construct($args = array()) { } /** + * Sets up the strings used in the update process. + * + * @since 3.0.0 */ public function add_strings() { } /** + * Displays a message about the update. + * + * @since 3.0.0 * @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support. * * @param string $feedback Message data. @@ -327,16 +359,25 @@ public function feedback($feedback, ...$args) { } /** + * Displays the header before the update process. + * + * @since 3.0.0 */ public function header() { } /** + * Displays the footer following the update process. + * + * @since 3.0.0 */ public function footer() { } /** + * Displays an error message about the update. + * + * @since 3.0.0 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * * @param string|WP_Error $errors Errors. @@ -345,33 +386,53 @@ public function error($errors) { } /** + * Displays the header before the bulk update process. + * + * @since 3.0.0 */ public function bulk_header() { } /** + * Displays the footer following the bulk update process. + * + * @since 3.0.0 */ public function bulk_footer() { } /** + * Performs an action before a bulk update. + * + * @since 3.0.0 + * * @param string $title */ public function before($title = '') { } /** + * Performs an action following a bulk update. + * + * @since 3.0.0 + * * @param string $title */ public function after($title = '') { } /** + * Resets the properties used in the update process. + * + * @since 3.0.0 */ public function reset() { } /** + * Flushes all output buffers. + * + * @since 3.0.0 */ public function flush_output() { @@ -400,25 +461,42 @@ class Bulk_Plugin_Upgrader_Skin extends \Bulk_Upgrader_Skin * The Plugin_Upgrader::bulk_upgrade() method will fill this in * with info retrieved from the get_plugin_data() function. * + * @since 3.0.0 * @var array Plugin data. Values will be empty if not supplied by the plugin. */ public $plugin_info = array(); + /** + * Sets up the strings used in the update process. + * + * @since 3.0.0 + */ public function add_strings() { } /** + * Performs an action before a bulk plugin update. + * + * @since 3.0.0 + * * @param string $title */ public function before($title = '') { } /** + * Performs an action following a bulk plugin update. + * + * @since 3.0.0 + * * @param string $title */ public function after($title = '') { } /** + * Displays the footer following the bulk update process. + * + * @since 3.0.0 */ public function bulk_footer() { @@ -448,25 +526,42 @@ class Bulk_Theme_Upgrader_Skin extends \Bulk_Upgrader_Skin * with info retrieved from the Theme_Upgrader::theme_info() method, * which in turn calls the wp_get_theme() function. * + * @since 3.0.0 * @var WP_Theme|false The theme's info object, or false. */ public $theme_info = \false; + /** + * Sets up the strings used in the update process. + * + * @since 3.0.0 + */ public function add_strings() { } /** + * Performs an action before a bulk theme update. + * + * @since 3.0.0 + * * @param string $title */ public function before($title = '') { } /** + * Performs an action following a bulk theme update. + * + * @since 3.0.0 + * * @param string $title */ public function after($title = '') { } /** + * Displays the footer following the bulk update process. + * + * @since 3.0.0 */ public function bulk_footer() { @@ -819,24 +914,58 @@ public function move_to_temp_backup_dir($args) * Restores the plugin or theme from temporary backup. * * @since 6.3.0 + * @since 6.6.0 Added the `$temp_backups` parameter. * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * + * @param array[] $temp_backups { + * Optional. An array of temporary backups. + * + * @type array ...$0 { + * Information about the backup. + * + * @type string $dir The temporary backup location in the upgrade-temp-backup directory. + * @type string $slug The item's slug. + * @type string $src The directory where the original is stored. For example, `WP_PLUGIN_DIR`. + * } + * } * @return bool|WP_Error True on success, false on early exit, otherwise WP_Error. + * @phpstan-param array $temp_backups */ - public function restore_temp_backup() + public function restore_temp_backup(array $temp_backups = array()) { } /** * Deletes a temporary backup. * * @since 6.3.0 + * @since 6.6.0 Added the `$temp_backups` parameter. * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * + * @param array[] $temp_backups { + * Optional. An array of temporary backups. + * + * @type array ...$0 { + * Information about the backup. + * + * @type string $dir The temporary backup location in the upgrade-temp-backup directory. + * @type string $slug The item's slug. + * @type string $src The directory where the original is stored. For example, `WP_PLUGIN_DIR`. + * } + * } * @return bool|WP_Error True on success, false on early exit, otherwise WP_Error. + * @phpstan-param array $temp_backups */ - public function delete_temp_backup() + public function delete_temp_backup(array $temp_backups = array()) { } } @@ -1832,17 +1961,29 @@ class Language_Pack_Upgrader_Skin extends \WP_Upgrader_Skin public $done_footer = \false; public $display_footer_actions = \true; /** + * Constructor. + * + * Sets up the language pack upgrader skin. + * + * @since 3.7.0 + * * @param array $args */ public function __construct($args = array()) { } /** + * Performs an action before a language pack update. + * + * @since 3.7.0 */ public function before() { } /** + * Displays an error message about the update. + * + * @since 3.7.0 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * * @param string|WP_Error $errors Errors. @@ -1851,11 +1992,17 @@ public function error($errors) { } /** + * Performs an action following a language pack update. + * + * @since 3.7.0 */ public function after() { } /** + * Displays the footer following the bulk update process. + * + * @since 3.7.0 */ public function bulk_footer() { @@ -1999,7 +2146,7 @@ public function clear_destination($remote_destination) { } } - /* For futur use + /* For future use define( 'PCLZIP_CB_PRE_LIST', 78005 ); define( 'PCLZIP_CB_POST_LIST', 78006 ); define( 'PCLZIP_CB_PRE_DELETE', 78007 ); @@ -2369,12 +2516,12 @@ function errorInfo($p_full = \false) // Function : privCheckFormat() // Description : // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) + // Several level of check exists. (future) // Parameters : // $p_level : Level of check. Default 0. // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) + // 1 : 0 + Check the central directory (future) + // 2 : 1 + Check each file header (future) // Return Values : // true on success, // false on error, the error code is set. @@ -2818,6 +2965,12 @@ class Plugin_Installer_Skin extends \WP_Upgrader_Skin public $url; public $overwrite; /** + * Constructor. + * + * Sets up the plugin installer skin. + * + * @since 2.8.0 + * * @param array $args */ public function __construct($args = array()) @@ -3154,6 +3307,12 @@ class Theme_Installer_Skin extends \WP_Upgrader_Skin public $url; public $overwrite; /** + * Constructor. + * + * Sets up the theme installer skin. + * + * @since 2.8.0 + * * @param array $args */ public function __construct($args = array()) @@ -5109,6 +5268,20 @@ protected function send_plugin_theme_email($type, $successful_updates, $failed_u protected function send_debug_email() { } + /** + * Performs a loopback request to check for potential fatal errors. + * + * Fatal errors cannot be detected unless maintenance mode is enabled. + * + * @since 6.6.0 + * + * @global int $upgrading The Unix timestamp marking when upgrading WordPress began. + * + * @return bool Whether a fatal error was detected. + */ + protected function has_fatal_error() + { + } } /** * List Table API: WP_Comments_List_Table class @@ -9775,7 +9948,7 @@ class WP_Posts_List_Table extends \WP_List_Table * * @see WP_List_Table::__construct() for more information on default arguments. * - * @global WP_Post_Type $post_type_object + * @global WP_Post_Type $post_type_object Global post type object. * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args An associative array of arguments. @@ -10882,7 +11055,7 @@ public function render_screen_meta() { } /** - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * * @return bool */ @@ -10911,7 +11084,7 @@ public function render_screen_options($options = array()) * * @since 4.4.0 * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * @phpstan-return void */ public function render_meta_boxes_preferences() @@ -11264,16 +11437,6 @@ public function get_test_php_sessions() public function get_test_sql_server() { } - /** - * Tests if the database server is capable of using utf8mb4. - * - * @since 5.2.0 - * - * @return array The test results. - */ - public function get_test_utf8mb4_support() - { - } /** * Tests if the site can communicate with WordPress.org. * @@ -11464,6 +11627,26 @@ public function get_test_page_cache() public function get_test_persistent_object_cache() { } + /** + * Calculates total amount of autoloaded data. + * + * @since 6.6.0 + * + * @return int Autoloaded data in bytes. + */ + public function get_autoloaded_options_size() + { + } + /** + * Tests the number of autoloaded options. + * + * @since 6.6.0 + * + * @return array The test results. + */ + public function get_test_autoloaded_options() + { + } /** * Returns a set of tests that belong to the site status page. * @@ -11762,8 +11945,8 @@ class WP_Terms_List_Table extends \WP_List_Table * * @see WP_List_Table::__construct() for more information on default arguments. * - * @global string $post_type - * @global string $taxonomy + * @global string $post_type Global post type. + * @global string $taxonomy Global taxonomy. * @global string $action * @global object $tax * @@ -11819,7 +12002,8 @@ public function display_rows_or_placeholder() { } /** - * @global string $taxonomy + * @global string $taxonomy Global taxonomy. + * * @param WP_Term $tag Term object. * @param int $level */ @@ -19129,8 +19313,10 @@ public static function parse($cookie_header, $name = '', $reference_time = null) * @param \WpOrg\Requests\Iri|null $origin URI for comparing cookie origins * @param int|null $time Reference time for expiration calculation * @return array + * + * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $origin argument is not null or an instance of the Iri class. */ - public static function parse_from_headers(\WpOrg\Requests\Response\Headers $headers, \WpOrg\Requests\Iri $origin = null, $time = null) + public static function parse_from_headers(\WpOrg\Requests\Response\Headers $headers, $origin = null, $time = null) { } } @@ -20647,7 +20833,7 @@ class Requests * * @var string */ - const VERSION = '2.0.9'; + const VERSION = '2.0.11'; /** * Selected transport name * @@ -29681,12 +29867,16 @@ function xml_escape($content) */ /** * Helper functions used to render the navigation block. + * + * @since 6.5.0 */ class WP_Navigation_Block_Renderer { /** * Renders the navigation block. * + * @since 6.5.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -31244,7 +31434,7 @@ public static function chunk_password($raw_password) /** * Core class used for interacting with block bindings sources. * - * @since 6.5.0 + * @since 6.5.0 */ final class WP_Block_Bindings_Registry { @@ -31263,31 +31453,31 @@ final class WP_Block_Bindings_Registry * * @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 { + * @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 callback $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 the target 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 array $uses_context (optional) Array of values to add to block `uses_context` needed by the 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 the target 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. * @phpstan-param array{ * label?: string, - * get_value_callback?: callback, - * uses_context?: array, + * get_value_callback?: callable, + * uses_context?: string[], * } $source_properties */ public function register(string $source_name, array $source_properties) @@ -31396,7 +31586,7 @@ final class WP_Block_Bindings_Source * The context added to the blocks needed by the source. * * @since 6.5.0 - * @var array|null + * @var string[]|null */ public $uses_context = \null; /** @@ -32221,11 +32411,12 @@ final class WP_Block_Styles_Registry * or with an inline tag. * * @since 5.3.0 + * @since 6.6.0 Added ability to register style across multiple block types along with theme.json-like style data. * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/ * - * @param string $block_name Block type name including namespace. - * @param array $style_properties { + * @param string|string[] $block_name Block type name including namespace or array of namespaced block type names. + * @param array $style_properties { * Array containing the properties of the style. * * @type string $name The identifier of the style used to compute a CSS class. @@ -32235,6 +32426,7 @@ final class WP_Block_Styles_Registry * @type string $style_handle The handle to an already registered style that should be * enqueued in places where block styles are needed. * @type bool $is_default Whether this is the default style for the block type. + * @type array $style_data Theme.json-like object to generate CSS from. * } * @return bool True if the block style was registered with success and false otherwise. * @phpstan-param array{ @@ -32243,6 +32435,7 @@ final class WP_Block_Styles_Registry * inline_style?: string, * style_handle?: string, * is_default?: bool, + * style_data?: array, * } $style_properties */ public function register($block_name, $style_properties) @@ -32883,12 +33076,12 @@ class WP_Block_Type * @since 5.8.0 Added the `variations` property. * @since 5.9.0 Added the `view_script` property. * @since 6.0.0 Added the `ancestor` property. - * @since 6.1.0 Added the `editor_script_handles`, `script_handles`, `view_script_handles, + * @since 6.1.0 Added the `editor_script_handles`, `script_handles`, `view_script_handles`, * `editor_style_handles`, and `style_handles` properties. * Deprecated the `editor_script`, `script`, `view_script`, `editor_style`, and `style` properties. * @since 6.3.0 Added the `selectors` property. * @since 6.4.0 Added the `block_hooks` property. - * @since 6.5.0 Added the `view_style_handles` property. + * @since 6.5.0 Added the `allowed_blocks`, `variation_callback`, and `view_style_handles` properties. * * @see register_block_type() * @@ -33104,7 +33297,7 @@ public function get_variations() * * @since 6.5.0 * - * @return array[] + * @return string[] */ public function get_uses_context() { @@ -33214,9 +33407,25 @@ class WP_Block * * @since 5.5.0 * - * @param array $block Array of parsed block properties. + * @param array $block { + * A representative array of a single parsed block object. See WP_Block_Parser_Block. + * + * @type string $blockName Name of block. + * @type array $attrs Attributes from block comment delimiters. + * @type array $innerBlocks List of inner blocks. An array of arrays that + * have the same structure as this one. + * @type string $innerHTML HTML from inside block comment delimiters. + * @type array $innerContent List of string fragments and null markers where inner blocks were found. + * } * @param array $available_context Optional array of ancestry context values. * @param WP_Block_Type_Registry $registry Optional block type registry. + * @phpstan-param array{ + * blockName?: string, + * attrs?: array, + * innerBlocks?: array, + * innerHTML?: string, + * innerContent?: array, + * } $block */ public function __construct($block, $available_context = array(), $registry = \null) { @@ -38941,6 +39150,18 @@ public static function register_duotone_support($block_type) public static function render_duotone_support($block_content, $block, $wp_block) { } + /** + * Fixes the issue with our generated class name not being added to the block's outer container + * in classic themes due to gutenberg_restore_image_outer_container from layout block supports. + * + * @since 6.6.0 + * + * @param string $block_content Rendered block content. + * @return string Filtered block content. + */ + public static function restore_image_outer_container($block_content) + { + } /** * Appends the used block duotone filter declarations to the inline block supports CSS. * @@ -41167,6 +41388,7 @@ class WP_Http const UNPROCESSABLE_ENTITY = 422; const LOCKED = 423; const FAILED_DEPENDENCY = 424; + const TOO_EARLY = 425; const UPGRADE_REQUIRED = 426; const PRECONDITION_REQUIRED = 428; const TOO_MANY_REQUESTS = 429; @@ -43021,6 +43243,7 @@ public function get_meridiem($meridiem) * * For backward compatibility only. * + * @since 2.1.0 * @deprecated For backward compatibility only. * * @global array $weekday @@ -43028,8 +43251,6 @@ public function get_meridiem($meridiem) * @global array $weekday_abbrev * @global array $month * @global array $month_abbrev - * - * @since 2.1.0 */ public function register_globals() { @@ -43250,7 +43471,7 @@ class WP_Meta_Query * - 'NOT IN' * - 'REGEXP' * - 'NOT REGEXP' - * - 'RLIKE', + * - 'RLIKE' * - 'EXISTS' (alias of '=') * - 'NOT EXISTS' (alias of '!=') * Default is 'IN' when `$key` is an array, '=' otherwise. @@ -43259,7 +43480,7 @@ class WP_Meta_Query * comparisons. Default is ''. * @type string|string[] $value Meta value or values to filter by. * @type string $compare MySQL operator used for comparing the $value. Accepts: - * - '=', + * - '=' * - '!=' * - '>' * - '>=' @@ -44464,7 +44685,7 @@ public function get_proxy_item_permissions_check() * @since 4.8.0 * * @see WP_oEmbed::get_html() - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * @global WP_Scripts $wp_scripts * * @param WP_REST_Request $request Full data about the request. @@ -44479,7 +44700,7 @@ public function get_proxy_item($request) * * Used internally by the WP_Embed class, but is designed to be generic. * - * @link https://wordpress.org/documentation/article/embeds/ + * @link https://developer.wordpress.org/advanced-administration/wordpress/oembed/ * @link http://oembed.com/ * * @package WordPress @@ -45098,8 +45319,6 @@ protected static function get_plugins() * Reads and stores dependency slugs from a plugin's 'Requires Plugins' header. * * @since 6.5.0 - * - * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. */ protected static function read_dependencies_from_plugin_headers() { @@ -52397,7 +52616,7 @@ public function init() * @param string $domain Text domain. * @param string $locale Locale. * - * @return string|false MO file path or false if there is none available. + * @return string|false Languages directory path or false if there is none available. */ public function get($domain, $locale) { @@ -52529,7 +52748,7 @@ class WP_Theme_JSON_Data * @param array $data Array following the theme.json specification. * @param string $origin The origin of the data: default, theme, user. */ - public function __construct($data = array(), $origin = 'theme') + public function __construct($data = array('version' => \WP_Theme_JSON::LATEST_SCHEMA), $origin = 'theme') { } /** @@ -52555,6 +52774,16 @@ public function update_with($new_data) public function get_data() { } + /** + * Returns theme JSON object. + * + * @since 6.6.0 + * + * @return WP_Theme_JSON The theme JSON structure stored in this data object. + */ + public function get_theme_json() + { + } } /** * WP_Theme_JSON_Resolver class @@ -52706,6 +52935,8 @@ protected static function has_same_registered_blocks($origin) * @since 5.8.0 * @since 5.9.0 Theme supports have been inlined and the `$theme_support_data` argument removed. * @since 6.0.0 Added an `$options` parameter to allow the theme data to be returned without theme supports. + * @since 6.6.0 Add support for 'default-font-sizes' and 'default-spacing-sizes' theme supports. + * Added registration and merging of block style variations from partial theme.json files and the block styles registry. * * @param array $deprecated Deprecated. Not used. * @param array $options { @@ -52756,6 +52987,8 @@ public static function get_user_data_from_wp_global_styles($theme, $create_post * Returns the user's origin config. * * @since 5.9.0 + * @since 6.6.0 The 'isGlobalStylesUserThemeJSON' flag is left on the user data. + * Register the block style variations coming from the user data. * * @return WP_Theme_JSON Entity that holds styles for user data. */ @@ -52856,10 +53089,40 @@ public static function clean_cached_data() * * @since 6.0.0 * @since 6.2.0 Returns parent theme variations if theme is a child. + * @since 6.6.0 Added configurable scope parameter to allow filtering + * theme.json partial files by the scope to which they + * can be applied e.g. theme vs block etc. + * Added basic caching for read theme.json partial files. * + * @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc. * @return array */ - public static function get_style_variations() + public static function get_style_variations($scope = 'theme') + { + } + /** + * Resolves relative paths in theme.json styles to theme absolute paths + * and returns them in an array that can be embedded + * as the value of `_link` object in REST API responses. + * + * @since 6.6.0 + * + * @param WP_Theme_JSON $theme_json A theme json instance. + * @return array An array of resolved paths. + */ + public static function get_resolved_theme_uris($theme_json) + { + } + /** + * Resolves relative paths in theme.json styles to theme absolute paths + * and merges them with incoming theme JSON. + * + * @since 6.6.0 + * + * @param WP_Theme_JSON $theme_json A theme json instance. + * @return WP_Theme_JSON Theme merged with resolved paths, if any found. + */ + public static function resolve_theme_file_uris($theme_json) { } } @@ -52892,12 +53155,15 @@ class WP_Theme_JSON_Schema * Function that migrates a given theme.json structure to the last version. * * @since 5.9.0 + * @since 6.6.0 Migrate up to v3 and add $origin parameter. * * @param array $theme_json The structure to migrate. - * + * @param string $origin Optional. What source of data this object represents. + * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. * @return array The structure in the last version. + * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ - public static function migrate($theme_json) + public static function migrate($theme_json, $origin = 'theme') { } } @@ -52937,6 +53203,13 @@ class WP_Theme_JSON * @var array */ protected static $blocks_metadata = array(); + /** + * The CSS selector for the top-level preset settings. + * + * @since 6.6.0 + * @var string + */ + const ROOT_CSS_PROPERTIES_SELECTOR = ':root'; /** * The CSS selector for the top-level styles. * @@ -53007,9 +53280,12 @@ class WP_Theme_JSON * `prevent_override` value for `color.duotone` to use `color.defaultDuotone`. * @since 6.2.0 Added 'shadow' presets. * @since 6.3.0 Replaced value_func for duotone with `null`. Custom properties are handled by class-wp-duotone.php. + * @since 6.6.0 Added the `dimensions.aspectRatios` and `dimensions.defaultAspectRatios` presets. + * Updated the 'prevent_override' value for font size presets to use 'typography.defaultFontSizes' + * and spacing size presets to use `spacing.defaultSpacingSizes`. * @var array */ - const PRESETS_METADATA = array(array('path' => array('color', 'palette'), 'prevent_override' => array('color', 'defaultPalette'), 'use_default_names' => \false, 'value_key' => 'color', 'css_vars' => '--wp--preset--color--$slug', 'classes' => array('.has-$slug-color' => 'color', '.has-$slug-background-color' => 'background-color', '.has-$slug-border-color' => 'border-color'), 'properties' => array('color', 'background-color', 'border-color')), array('path' => array('color', 'gradients'), 'prevent_override' => array('color', 'defaultGradients'), 'use_default_names' => \false, 'value_key' => 'gradient', 'css_vars' => '--wp--preset--gradient--$slug', 'classes' => array('.has-$slug-gradient-background' => 'background'), 'properties' => array('background')), array( + const PRESETS_METADATA = array(array('path' => array('dimensions', 'aspectRatios'), 'prevent_override' => array('dimensions', 'defaultAspectRatios'), 'use_default_names' => \false, 'value_key' => 'ratio', 'css_vars' => '--wp--preset--aspect-ratio--$slug', 'classes' => array(), 'properties' => array('aspect-ratio')), array('path' => array('color', 'palette'), 'prevent_override' => array('color', 'defaultPalette'), 'use_default_names' => \false, 'value_key' => 'color', 'css_vars' => '--wp--preset--color--$slug', 'classes' => array('.has-$slug-color' => 'color', '.has-$slug-background-color' => 'background-color', '.has-$slug-border-color' => 'border-color'), 'properties' => array('color', 'background-color', 'border-color')), array('path' => array('color', 'gradients'), 'prevent_override' => array('color', 'defaultGradients'), 'use_default_names' => \false, 'value_key' => 'gradient', 'css_vars' => '--wp--preset--gradient--$slug', 'classes' => array('.has-$slug-gradient-background' => 'background'), 'properties' => array('background')), array( 'path' => array('color', 'duotone'), 'prevent_override' => array('color', 'defaultDuotone'), 'use_default_names' => \false, @@ -53018,7 +53294,7 @@ class WP_Theme_JSON 'css_vars' => \null, 'classes' => array(), 'properties' => array('filter'), - ), array('path' => array('typography', 'fontSizes'), 'prevent_override' => \false, 'use_default_names' => \true, 'value_func' => 'wp_get_typography_font_size_value', 'css_vars' => '--wp--preset--font-size--$slug', 'classes' => array('.has-$slug-font-size' => 'font-size'), 'properties' => array('font-size')), array('path' => array('typography', 'fontFamilies'), 'prevent_override' => \false, 'use_default_names' => \false, 'value_key' => 'fontFamily', 'css_vars' => '--wp--preset--font-family--$slug', 'classes' => array('.has-$slug-font-family' => 'font-family'), 'properties' => array('font-family')), array('path' => array('spacing', 'spacingSizes'), 'prevent_override' => \false, 'use_default_names' => \true, 'value_key' => 'size', 'css_vars' => '--wp--preset--spacing--$slug', 'classes' => array(), 'properties' => array('padding', 'margin')), array('path' => array('shadow', 'presets'), 'prevent_override' => array('shadow', 'defaultPresets'), 'use_default_names' => \false, 'value_key' => 'shadow', 'css_vars' => '--wp--preset--shadow--$slug', 'classes' => array(), 'properties' => array('box-shadow'))); + ), array('path' => array('typography', 'fontSizes'), 'prevent_override' => array('typography', 'defaultFontSizes'), 'use_default_names' => \true, 'value_func' => 'wp_get_typography_font_size_value', 'css_vars' => '--wp--preset--font-size--$slug', 'classes' => array('.has-$slug-font-size' => 'font-size'), 'properties' => array('font-size')), array('path' => array('typography', 'fontFamilies'), 'prevent_override' => \false, 'use_default_names' => \false, 'value_key' => 'fontFamily', 'css_vars' => '--wp--preset--font-family--$slug', 'classes' => array('.has-$slug-font-family' => 'font-family'), 'properties' => array('font-family')), array('path' => array('spacing', 'spacingSizes'), 'prevent_override' => array('spacing', 'defaultSpacingSizes'), 'use_default_names' => \true, 'value_key' => 'size', 'css_vars' => '--wp--preset--spacing--$slug', 'classes' => array(), 'properties' => array('padding', 'margin')), array('path' => array('shadow', 'presets'), 'prevent_override' => array('shadow', 'defaultPresets'), 'use_default_names' => \false, 'value_key' => 'shadow', 'css_vars' => '--wp--preset--shadow--$slug', 'classes' => array(), 'properties' => array('box-shadow'))); /** * Metadata for style properties. * @@ -53037,10 +53313,11 @@ class WP_Theme_JSON * @since 6.3.0 Added `column-count` property. * @since 6.4.0 Added `writing-mode` property. * @since 6.5.0 Added `aspect-ratio` property. + * @since 6.6.0 Added `background-[image|position|repeat|size]` properties. * * @var array */ - const PROPERTIES_METADATA = array('aspect-ratio' => array('dimensions', 'aspectRatio'), 'background' => array('color', 'gradient'), 'background-color' => array('color', 'background'), 'border-radius' => array('border', 'radius'), 'border-top-left-radius' => array('border', 'radius', 'topLeft'), 'border-top-right-radius' => array('border', 'radius', 'topRight'), 'border-bottom-left-radius' => array('border', 'radius', 'bottomLeft'), 'border-bottom-right-radius' => array('border', 'radius', 'bottomRight'), 'border-color' => array('border', 'color'), 'border-width' => array('border', 'width'), 'border-style' => array('border', 'style'), 'border-top-color' => array('border', 'top', 'color'), 'border-top-width' => array('border', 'top', 'width'), 'border-top-style' => array('border', 'top', 'style'), 'border-right-color' => array('border', 'right', 'color'), 'border-right-width' => array('border', 'right', 'width'), 'border-right-style' => array('border', 'right', 'style'), 'border-bottom-color' => array('border', 'bottom', 'color'), 'border-bottom-width' => array('border', 'bottom', 'width'), 'border-bottom-style' => array('border', 'bottom', 'style'), 'border-left-color' => array('border', 'left', 'color'), 'border-left-width' => array('border', 'left', 'width'), 'border-left-style' => array('border', 'left', 'style'), 'color' => array('color', 'text'), 'column-count' => array('typography', 'textColumns'), 'font-family' => array('typography', 'fontFamily'), 'font-size' => array('typography', 'fontSize'), 'font-style' => array('typography', 'fontStyle'), 'font-weight' => array('typography', 'fontWeight'), 'letter-spacing' => array('typography', 'letterSpacing'), 'line-height' => array('typography', 'lineHeight'), 'margin' => array('spacing', 'margin'), 'margin-top' => array('spacing', 'margin', 'top'), 'margin-right' => array('spacing', 'margin', 'right'), 'margin-bottom' => array('spacing', 'margin', 'bottom'), 'margin-left' => array('spacing', 'margin', 'left'), 'min-height' => array('dimensions', 'minHeight'), 'outline-color' => array('outline', 'color'), 'outline-offset' => array('outline', 'offset'), 'outline-style' => array('outline', 'style'), 'outline-width' => array('outline', 'width'), 'padding' => array('spacing', 'padding'), 'padding-top' => array('spacing', 'padding', 'top'), 'padding-right' => array('spacing', 'padding', 'right'), 'padding-bottom' => array('spacing', 'padding', 'bottom'), 'padding-left' => array('spacing', 'padding', 'left'), '--wp--style--root--padding' => array('spacing', 'padding'), '--wp--style--root--padding-top' => array('spacing', 'padding', 'top'), '--wp--style--root--padding-right' => array('spacing', 'padding', 'right'), '--wp--style--root--padding-bottom' => array('spacing', 'padding', 'bottom'), '--wp--style--root--padding-left' => array('spacing', 'padding', 'left'), 'text-decoration' => array('typography', 'textDecoration'), 'text-transform' => array('typography', 'textTransform'), 'filter' => array('filter', 'duotone'), 'box-shadow' => array('shadow'), 'writing-mode' => array('typography', 'writingMode')); + const PROPERTIES_METADATA = array('aspect-ratio' => array('dimensions', 'aspectRatio'), 'background' => array('color', 'gradient'), 'background-color' => array('color', 'background'), 'background-image' => array('background', 'backgroundImage'), 'background-position' => array('background', 'backgroundPosition'), 'background-repeat' => array('background', 'backgroundRepeat'), 'background-size' => array('background', 'backgroundSize'), 'border-radius' => array('border', 'radius'), 'border-top-left-radius' => array('border', 'radius', 'topLeft'), 'border-top-right-radius' => array('border', 'radius', 'topRight'), 'border-bottom-left-radius' => array('border', 'radius', 'bottomLeft'), 'border-bottom-right-radius' => array('border', 'radius', 'bottomRight'), 'border-color' => array('border', 'color'), 'border-width' => array('border', 'width'), 'border-style' => array('border', 'style'), 'border-top-color' => array('border', 'top', 'color'), 'border-top-width' => array('border', 'top', 'width'), 'border-top-style' => array('border', 'top', 'style'), 'border-right-color' => array('border', 'right', 'color'), 'border-right-width' => array('border', 'right', 'width'), 'border-right-style' => array('border', 'right', 'style'), 'border-bottom-color' => array('border', 'bottom', 'color'), 'border-bottom-width' => array('border', 'bottom', 'width'), 'border-bottom-style' => array('border', 'bottom', 'style'), 'border-left-color' => array('border', 'left', 'color'), 'border-left-width' => array('border', 'left', 'width'), 'border-left-style' => array('border', 'left', 'style'), 'color' => array('color', 'text'), 'text-align' => array('typography', 'textAlign'), 'column-count' => array('typography', 'textColumns'), 'font-family' => array('typography', 'fontFamily'), 'font-size' => array('typography', 'fontSize'), 'font-style' => array('typography', 'fontStyle'), 'font-weight' => array('typography', 'fontWeight'), 'letter-spacing' => array('typography', 'letterSpacing'), 'line-height' => array('typography', 'lineHeight'), 'margin' => array('spacing', 'margin'), 'margin-top' => array('spacing', 'margin', 'top'), 'margin-right' => array('spacing', 'margin', 'right'), 'margin-bottom' => array('spacing', 'margin', 'bottom'), 'margin-left' => array('spacing', 'margin', 'left'), 'min-height' => array('dimensions', 'minHeight'), 'outline-color' => array('outline', 'color'), 'outline-offset' => array('outline', 'offset'), 'outline-style' => array('outline', 'style'), 'outline-width' => array('outline', 'width'), 'padding' => array('spacing', 'padding'), 'padding-top' => array('spacing', 'padding', 'top'), 'padding-right' => array('spacing', 'padding', 'right'), 'padding-bottom' => array('spacing', 'padding', 'bottom'), 'padding-left' => array('spacing', 'padding', 'left'), '--wp--style--root--padding' => array('spacing', 'padding'), '--wp--style--root--padding-top' => array('spacing', 'padding', 'top'), '--wp--style--root--padding-right' => array('spacing', 'padding', 'right'), '--wp--style--root--padding-bottom' => array('spacing', 'padding', 'bottom'), '--wp--style--root--padding-left' => array('spacing', 'padding', 'left'), 'text-decoration' => array('typography', 'textDecoration'), 'text-transform' => array('typography', 'textTransform'), 'filter' => array('filter', 'duotone'), 'box-shadow' => array('shadow'), 'writing-mode' => array('typography', 'writingMode')); /** * Indirect metadata for style properties that are not directly output. * @@ -53049,13 +53326,14 @@ class WP_Theme_JSON * * Indirect properties are not output directly by `compute_style_properties`, * but are used elsewhere in the processing of global styles. The indirect - * property is used to validate whether or not a style value is allowed. + * property is used to validate whether a style value is allowed. * * @since 6.2.0 + * @since 6.6.0 Added background-image properties. * * @var array */ - const INDIRECT_PROPERTIES_METADATA = array('gap' => array(array('spacing', 'blockGap')), 'column-gap' => array(array('spacing', 'blockGap', 'left')), 'row-gap' => array(array('spacing', 'blockGap', 'top')), 'max-width' => array(array('layout', 'contentSize'), array('layout', 'wideSize'))); + const INDIRECT_PROPERTIES_METADATA = array('gap' => array(array('spacing', 'blockGap')), 'column-gap' => array(array('spacing', 'blockGap', 'left')), 'row-gap' => array(array('spacing', 'blockGap', 'top')), 'max-width' => array(array('layout', 'contentSize'), array('layout', 'wideSize')), 'background-image' => array(array('background', 'backgroundImage', 'url'))); /** * Protected style properties. * @@ -53075,9 +53353,10 @@ class WP_Theme_JSON * @since 5.9.0 Renamed from `ALLOWED_TOP_LEVEL_KEYS` to `VALID_TOP_LEVEL_KEYS`, * added the `customTemplates` and `templateParts` values. * @since 6.3.0 Added the `description` value. + * @since 6.6.0 Added `blockTypes` to support block style variation theme.json partials. * @var string[] */ - const VALID_TOP_LEVEL_KEYS = array('customTemplates', 'description', 'patterns', 'settings', 'styles', 'templateParts', 'title', 'version'); + const VALID_TOP_LEVEL_KEYS = array('blockTypes', 'customTemplates', 'description', 'patterns', 'settings', 'slug', 'styles', 'templateParts', 'title', 'version'); /** * The valid properties under the settings key. * @@ -53094,9 +53373,11 @@ class WP_Theme_JSON * `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`. * @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize`, * `background.backgroundSize` and `dimensions.aspectRatio`. + * @since 6.6.0 Added support for 'dimensions.aspectRatios', 'dimensions.defaultAspectRatios', + * 'typography.defaultFontSizes', and 'spacing.defaultSpacingSizes'. * @var array */ - const VALID_SETTINGS = array('appearanceTools' => \null, 'useRootPaddingAwareAlignments' => \null, 'background' => array('backgroundImage' => \null, 'backgroundSize' => \null), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null), 'color' => array('background' => \null, 'custom' => \null, 'customDuotone' => \null, 'customGradient' => \null, 'defaultDuotone' => \null, 'defaultGradients' => \null, 'defaultPalette' => \null, 'duotone' => \null, 'gradients' => \null, 'link' => \null, 'heading' => \null, 'button' => \null, 'caption' => \null, 'palette' => \null, 'text' => \null), 'custom' => \null, 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'layout' => array('contentSize' => \null, 'wideSize' => \null, 'allowEditing' => \null, 'allowCustomContentAndWideSize' => \null), 'lightbox' => array('enabled' => \null, 'allowEditing' => \null), 'position' => array('fixed' => \null, 'sticky' => \null), 'spacing' => array('customSpacingSize' => \null, 'spacingSizes' => \null, 'spacingScale' => \null, 'blockGap' => \null, 'margin' => \null, 'padding' => \null, 'units' => \null), 'shadow' => array('presets' => \null, 'defaultPresets' => \null), 'typography' => array('fluid' => \null, 'customFontSize' => \null, 'dropCap' => \null, 'fontFamilies' => \null, 'fontSizes' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null)); + const VALID_SETTINGS = array('appearanceTools' => \null, 'useRootPaddingAwareAlignments' => \null, 'background' => array('backgroundImage' => \null, 'backgroundSize' => \null), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null), 'color' => array('background' => \null, 'custom' => \null, 'customDuotone' => \null, 'customGradient' => \null, 'defaultDuotone' => \null, 'defaultGradients' => \null, 'defaultPalette' => \null, 'duotone' => \null, 'gradients' => \null, 'link' => \null, 'heading' => \null, 'button' => \null, 'caption' => \null, 'palette' => \null, 'text' => \null), 'custom' => \null, 'dimensions' => array('aspectRatio' => \null, 'aspectRatios' => \null, 'defaultAspectRatios' => \null, 'minHeight' => \null), 'layout' => array('contentSize' => \null, 'wideSize' => \null, 'allowEditing' => \null, 'allowCustomContentAndWideSize' => \null), 'lightbox' => array('enabled' => \null, 'allowEditing' => \null), 'position' => array('fixed' => \null, 'sticky' => \null), 'spacing' => array('customSpacingSize' => \null, 'defaultSpacingSizes' => \null, 'spacingSizes' => \null, 'spacingScale' => \null, 'blockGap' => \null, 'margin' => \null, 'padding' => \null, 'units' => \null), 'shadow' => array('presets' => \null, 'defaultPresets' => \null), 'typography' => array('fluid' => \null, 'customFontSize' => \null, 'defaultFontSizes' => \null, 'dropCap' => \null, 'fontFamilies' => \null, 'fontSizes' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null)); /* * The valid properties for fontFamilies under settings key. * @@ -53118,10 +53399,11 @@ class WP_Theme_JSON * @since 6.2.0 Added `outline`, and `minHeight` properties. * @since 6.3.0 Added support for `typography.textColumns`. * @since 6.5.0 Added support for `dimensions.aspectRatio`. + * @since 6.6.0 Added `background` sub properties to top-level only. * * @var array */ - const VALID_STYLES = array('border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null, 'top' => \null, 'right' => \null, 'bottom' => \null, 'left' => \null), 'color' => array('background' => \null, 'gradient' => \null, 'text' => \null), 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'filter' => array('duotone' => \null), 'outline' => array('color' => \null, 'offset' => \null, 'style' => \null, 'width' => \null), 'shadow' => \null, 'spacing' => array('margin' => \null, 'padding' => \null, 'blockGap' => \null), 'typography' => array('fontFamily' => \null, 'fontSize' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null), 'css' => \null); + const VALID_STYLES = array('background' => array('backgroundImage' => 'top', 'backgroundPosition' => 'top', 'backgroundRepeat' => 'top', 'backgroundSize' => 'top'), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null, 'top' => \null, 'right' => \null, 'bottom' => \null, 'left' => \null), 'color' => array('background' => \null, 'gradient' => \null, 'text' => \null), 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'filter' => array('duotone' => \null), 'outline' => array('color' => \null, 'offset' => \null, 'style' => \null, 'width' => \null), 'shadow' => \null, 'spacing' => array('margin' => \null, 'padding' => \null, 'blockGap' => \null), 'typography' => array('fontFamily' => \null, 'fontSize' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null), 'css' => \null); /** * Defines which pseudo selectors are enabled for which elements. * @@ -53236,20 +53518,23 @@ public static function get_element_class_name($element) * * @since 5.8.0 * @since 5.9.0 Changed value from 1 to 2. + * @since 6.6.0 Changed value from 2 to 3. * @var int */ - const LATEST_SCHEMA = 2; + const LATEST_SCHEMA = 3; /** * Constructor. * * @since 5.8.0 + * @since 6.6.0 Key spacingScale by origin, and Pre-generate the spacingSizes from spacingScale. + * Added unwrapping of shared block style variations into block type variations if registered. * * @param array $theme_json A structure that follows the theme.json schema. * @param string $origin Optional. What source of data this object represents. - * One of 'default', 'theme', or 'custom'. Default 'theme'. - * @phpstan-param 'default'|'theme'|'custom' $origin + * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. + * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ - public function __construct($theme_json = array(), $origin = 'theme') + public function __construct($theme_json = array('version' => self::LATEST_SCHEMA), $origin = 'theme') { } /** @@ -53279,6 +53564,7 @@ protected static function do_opt_in_into_settings(&$context) * @since 5.8.0 * @since 5.9.0 Added the `$valid_block_names` and `$valid_element_name` parameters. * @since 6.3.0 Added the `$valid_variations` parameter. + * @since 6.6.0 Updated schema to allow extended block style variations. * * @param array $input Structure to sanitize. * @param array $valid_block_names List of valid block names. @@ -53351,6 +53637,7 @@ protected static function prepend_to_selector($selector, $to_prepend) * @since 5.9.0 Added `duotone` key with CSS selector. * @since 6.1.0 Added `features` key with block support feature level selectors. * @since 6.3.0 Refactored and stabilized selectors API. + * @since 6.6.0 Updated to include block style variations from the block styles registry. * * @return array Block metadata. */ @@ -53403,17 +53690,29 @@ public function get_settings() * @since 5.8.0 * @since 5.9.0 Removed the `$type` parameter, added the `$types` and `$origins` parameters. * @since 6.3.0 Add fallback layout styles for Post Template when block gap support isn't available. + * @since 6.6.0 Added boolean `skip_root_layout_styles` and `include_block_style_variations` options + * to control styles output as desired. * * @param string[] $types Types of styles to load. Will load all by default. It accepts: * - `variables`: only the CSS Custom Properties for presets & custom ones. * - `styles`: only the styles section in theme.json. * - `presets`: only the classes for the presets. * @param string[] $origins A list of origins to include. By default it includes VALID_ORIGINS. - * @param array $options An array of options for now used for internal purposes only (may change without notice). - * The options currently supported are 'scope' that makes sure all style are scoped to a - * given selector, and root_selector which overwrites and forces a given selector to be - * used on the root node. + * @param array $options { + * Optional. An array of options for now used for internal purposes only (may change without notice). + * + * @type string $scope Makes sure all style are scoped to a given selector + * @type string $root_selector Overwrites and forces a given selector to be used on the root node + * @type bool $skip_root_layout_styles Omits root layout styles from the generated stylesheet. Default false. + * @type bool $include_block_style_variations Includes styles for block style variations in the generated stylesheet. Default false. + * } * @return string The resulting stylesheet. + * @phpstan-param array{ + * scope?: string, + * root_selector?: string, + * skip_root_layout_styles?: bool, + * include_block_style_variations?: bool, + * } $options */ public function get_stylesheet($types = array('variables', 'styles', 'presets'), $origins = \null, $options = array()) { @@ -53422,6 +53721,7 @@ public function get_stylesheet($types = array('variables', 'styles', 'presets'), * Processes the CSS, to apply nesting. * * @since 6.2.0 + * @since 6.6.0 Enforced 0-1-0 specificity for block custom CSS selectors. * * @param string $css The CSS to process. * @param string $selector The selector to nest. @@ -53491,6 +53791,7 @@ protected function get_block_classes($style_nodes) * @since 6.3.0 Reduced specificity for layout margin rules. * @since 6.5.1 Only output rules referencing content and wide sizes when values exist. * @since 6.5.3 Add types parameter to check if only base layout styles are needed. + * @since 6.6.0 Updated layout style specificity to be compatible with overall 0-1-0 specificity in global styles. * * @param array $block_metadata Metadata about the block to get styles for. * @param array $types Optional. Types of styles to output. If empty, all styles will be output. @@ -53574,6 +53875,7 @@ protected static function to_ruleset($selector, $declarations) * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. + * @since 6.6.0 Added check for root CSS properties selector. * * @param array $settings Settings to process. * @param string $selector Selector wrapping the classes. @@ -53595,6 +53897,7 @@ protected static function compute_preset_classes($settings, $selector, $origins) * * * @since 5.9.0 + * @since 6.6.0 Added early return if missing scope or selector. * * @param string $scope Selector to scope to. * @param string $selector Original selector. @@ -53603,6 +53906,21 @@ protected static function compute_preset_classes($settings, $selector, $origins) public static function scope_selector($scope, $selector) { } + /** + * Scopes the selectors for a given style node. + * + * This includes the primary selector, i.e. `$node['selector']`, as well as any custom + * selectors for features and subfeatures, e.g. `$node['selectors']['border']` etc. + * + * @since 6.6.0 + * + * @param string $scope Selector to scope to. + * @param array $node Style node with selectors to scope. + * @return array Node with updated selectors. + */ + protected static function scope_style_node_selectors($scope, $node) + { + } /** * Gets preset values keyed by slugs based on settings and metadata. * @@ -53633,6 +53951,7 @@ public static function scope_selector($scope, $selector) * * * @since 5.9.0 + * @since 6.6.0 Passing $settings to the callbacks defined in static::PRESETS_METADATA. * * @param array $settings Settings to process. * @param array $preset_metadata One of the PRESETS_METADATA values. @@ -53758,6 +54077,7 @@ protected static function flatten_tree($tree, $prefix = '', $token = '--') * @since 5.9.0 Added the `$settings` and `$properties` parameters. * @since 6.1.0 Added `$theme_json`, `$selector`, and `$use_root_padding` parameters. * @since 6.5.0 Output a `min-height: unset` rule when `aspect-ratio` is set. + * @since 6.6.0 Pass current theme JSON settings to wp_get_typography_font_size_value(), and process background properties. * * @param array $styles Styles to process. * @param array $settings Theme settings. @@ -53833,12 +54153,21 @@ protected static function get_setting_nodes($theme_json, $selectors = array()) * ] * * @since 5.8.0 + * @since 6.6.0 Added options array for modifying generated nodes. * * @param array $theme_json The tree to extract style nodes from. * @param array $selectors List of selectors per block. + * @param array $options { + * Optional. An array of options for now used for internal purposes only (may change without notice). + * + * @type bool $include_block_style_variations Includes style nodes for block style variations. Default false. + * } * @return array An array of style nodes metadata. + * @phpstan-param array{ + * include_block_style_variations?: bool, + * } $options */ - protected static function get_style_nodes($theme_json, $selectors = array()) + protected static function get_style_nodes($theme_json, $selectors = array(), $options = array()) { } /** @@ -53855,6 +54184,9 @@ public function get_styles_block_nodes() * Gets the CSS rules for a particular block from theme.json. * * @since 6.1.0 + * @since 6.6.0 Setting a min-height of HTML when root styles have a background gradient or image. + * Updated general global styles specificity to 0-1-0. + * Fixed custom CSS output in block style variations. * * @param array $block_metadata Metadata about the block to get styles for. * @@ -53867,6 +54199,8 @@ public function get_styles_for_block($block_metadata) * Outputs the CSS for layout rules on the root. * * @since 6.1.0 + * @since 6.6.0 Use `ROOT_CSS_PROPERTIES_SELECTOR` for CSS custom properties and improved consistency of root padding rules. + * Updated specificity of body margin reset and first/last child selectors. * * @param string $selector The root node selector. * @param array $block_metadata The metadata for the root block. @@ -53939,7 +54273,7 @@ protected static function should_override_preset($theme_json, $path, $override) } /** * Returns the default slugs for all the presets in an associative array - * whose keys are the preset paths and the leafs is the list of slugs. + * whose keys are the preset paths and the leaves is the list of slugs. * * For example: * @@ -53988,11 +54322,15 @@ protected static function filter_slugs($node, $slugs) * * @since 5.9.0 * @since 6.3.2 Preserves global styles block variations when securing styles. + * @since 6.6.0 Updated to allow variation element styles and $origin parameter. * - * @param array $theme_json Structure to sanitize. + * @param array $theme_json Structure to sanitize. + * @param string $origin Optional. What source of data this object represents. + * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. * @return array Sanitized structure. + * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ - public static function remove_insecure_properties($theme_json) + public static function remove_insecure_properties($theme_json, $origin = 'theme') { } /** @@ -54081,6 +54419,9 @@ public function get_data() * Sets the spacingSizes array based on the spacingScale values from theme.json. * * @since 6.1.0 + * @deprecated 6.6.0 No longer used as the spacingSizes are automatically + * generated in the constructor and merge methods instead + * of manually after instantiation. * * @return null|void */ @@ -54150,6 +54491,16 @@ public static function resolve_variables($theme_json) protected static function get_block_style_variation_selector($variation_name, $block_selector) { } + /** + * Collects valid block style variations keyed by block type. + * + * @since 6.6.0 + * + * @return array Valid block style variations by block type. + */ + protected static function get_valid_block_style_variations() + { + } } /** * WP_Theme Class @@ -54671,6 +55022,7 @@ public function get_block_patterns() * Clears block pattern cache. * * @since 6.4.0 + * @since 6.6.0 Uses transients to cache regardless of site environment. */ public function delete_pattern_cache() { @@ -54708,6 +55060,332 @@ public static function sort_by_name(&$themes) { } } + /** + * Class for efficiently looking up and mapping string keys to string values, with limits. + * + * @package WordPress + * @since 6.6.0 + */ + /** + * WP_Token_Map class. + * + * Use this class in specific circumstances with a static set of lookup keys which map to + * a static set of transformed values. For example, this class is used to map HTML named + * character references to their equivalent UTF-8 values. + * + * This class works differently than code calling `in_array()` and other methods. It + * internalizes lookup logic and provides helper interfaces to optimize lookup and + * transformation. It provides a method for precomputing the lookup tables and storing + * them as PHP source code. + * + * All tokens and substitutions must be shorter than 256 bytes. + * + * Example: + * + * $smilies = WP_Token_Map::from_array( array( + * '8O' => '😯', + * ':(' => '🙁', + * ':)' => '🙂', + * ':?' => '😕', + * ) ); + * + * true === $smilies->contains( ':)' ); + * false === $smilies->contains( 'simile' ); + * + * '😕' === $smilies->read_token( 'Not sure :?.', 9, $length_of_smily_syntax ); + * 2 === $length_of_smily_syntax; + * + * ## Precomputing the Token Map. + * + * Creating the class involves some work sorting and organizing the tokens and their + * replacement values. In order to skip this, it's possible for the class to export + * its state and be used as actual PHP source code. + * + * Example: + * + * // Export with four spaces as the indent, only for the sake of this docblock. + * // The default indent is a tab character. + * $indent = ' '; + * echo $smilies->precomputed_php_source_table( $indent ); + * + * // Output, to be pasted into a PHP source file: + * WP_Token_Map::from_precomputed_table( + * array( + * "storage_version" => "6.6.0", + * "key_length" => 2, + * "groups" => "", + * "long_words" => array(), + * "small_words" => "8O\x00:)\x00:(\x00:?\x00", + * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) + * ) + * ); + * + * ## Large vs. small words. + * + * This class uses a short prefix called the "key" to optimize lookup of its tokens. + * This means that some tokens may be shorter than or equal in length to that key. + * Those words that are longer than the key are called "large" while those shorter + * than or equal to the key length are called "small." + * + * This separation of large and small words is incidental to the way this class + * optimizes lookup, and should be considered an internal implementation detail + * of the class. It may still be important to be aware of it, however. + * + * ## Determining Key Length. + * + * The choice of the size of the key length should be based on the data being stored in + * the token map. It should divide the data as evenly as possible, but should not create + * so many groups that a large fraction of the groups only contain a single token. + * + * For the HTML5 named character references, a key length of 2 was found to provide a + * sufficient spread and should be a good default for relatively large sets of tokens. + * + * However, for some data sets this might be too long. For example, a list of smilies + * may be too small for a key length of 2. Perhaps 1 would be more appropriate. It's + * best to experiment and determine empirically which values are appropriate. + * + * ## Generate Pre-Computed Source Code. + * + * Since the `WP_Token_Map` is designed for relatively static lookups, it can be + * advantageous to precompute the values and instantiate a table that has already + * sorted and grouped the tokens and built the lookup strings. + * + * This can be done with `WP_Token_Map::precomputed_php_source_table()`. + * + * Note that if there is a leading character that all tokens need, such as `&` for + * HTML named character references, it can be beneficial to exclude this from the + * token map. Instead, find occurrences of the leading character and then use the + * token map to see if the following characters complete the token. + * + * Example: + * + * $map = WP_Token_Map::from_array( array( 'simple_smile:' => '🙂', 'sob:' => '😭', 'soba:' => '🍜' ) ); + * echo $map->precomputed_php_source_table(); + * // Output + * WP_Token_Map::from_precomputed_table( + * array( + * "storage_version" => "6.6.0", + * "key_length" => 2, + * "groups" => "si\x00so\x00", + * "long_words" => array( + * // simple_smile:[🙂]. + * "\x0bmple_smile:\x04🙂", + * // soba:[🍜] sob:[😭]. + * "\x03ba:\x04🍜\x02b:\x04😭", + * ), + * "short_words" => "", + * "short_mappings" => array() + * } + * ); + * + * This precomputed value can be stored directly in source code and will skip the + * startup cost of generating the lookup strings. See `$html5_named_character_entities`. + * + * Note that any updates to the precomputed format should update the storage version + * constant. It would also be best to provide an update function to take older known + * versions and upgrade them in place when loading into `from_precomputed_table()`. + * + * ## Future Direction. + * + * It may be viable to dynamically increase the length limits such that there's no need to impose them. + * The limit appears because of the packing structure, which indicates how many bytes each segment of + * text in the lookup tables spans. If, however, care were taken to track the longest word length, then + * the packing structure could change its representation to allow for that. Each additional byte storing + * length, however, increases the memory overhead and lookup runtime. + * + * An alternative approach could be to borrow the UTF-8 variable-length encoding and store lengths of less + * than 127 as a single byte with the high bit unset, storing longer lengths as the combination of + * continuation bytes. + * + * Since it has not been shown during the development of this class that longer strings are required, this + * update is deferred until such a need is clear. + * + * @since 6.6.0 + */ + class WP_Token_Map + { + /** + * Denotes the version of the code which produces pre-computed source tables. + * + * This version will be used not only to verify pre-computed data, but also + * to upgrade pre-computed data from older versions. Choosing a name that + * corresponds to the WordPress release will help people identify where an + * old copy of data came from. + */ + const STORAGE_VERSION = '6.6.0-trunk'; + /** + * Maximum length for each key and each transformed value in the table (in bytes). + * + * @since 6.6.0 + */ + const MAX_LENGTH = 256; + /** + * Create a token map using an associative array of key/value pairs as the input. + * + * Example: + * + * $smilies = WP_Token_Map::from_array( array( + * '8O' => '😯', + * ':(' => '🙁', + * ':)' => '🙂', + * ':?' => '😕', + * ) ); + * + * @since 6.6.0 + * + * @param array $mappings The keys transform into the values, both are strings. + * @param int $key_length Determines the group key length. Leave at the default value + * of 2 unless there's an empirical reason to change it. + * + * @return WP_Token_Map|null Token map, unless unable to create it. + */ + public static function from_array($mappings, $key_length = 2) + { + } + /** + * Creates a token map from a pre-computed table. + * This skips the initialization cost of generating the table. + * + * This function should only be used to load data created with + * WP_Token_Map::precomputed_php_source_tag(). + * + * @since 6.6.0 + * + * @param array $state { + * Stores pre-computed state for directly loading into a Token Map. + * + * @type string $storage_version Which version of the code produced this state. + * @type int $key_length Group key length. + * @type string $groups Group lookup index. + * @type array $large_words Large word groups and packed strings. + * @type string $small_words Small words packed string. + * @type array $small_mappings Small word mappings. + * } + * + * @return WP_Token_Map Map with precomputed data loaded. + * @phpstan-param array{ + * storage_version?: string, + * key_length?: int, + * groups?: string, + * large_words?: array, + * small_words?: string, + * small_mappings?: array, + * } $state + */ + public static function from_precomputed_table($state) + { + } + /** + * Indicates if a given word is a lookup key in the map. + * + * Example: + * + * true === $smilies->contains( ':)' ); + * false === $smilies->contains( 'simile' ); + * + * @since 6.6.0 + * + * @param string $word Determine if this word is a lookup key in the map. + * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. + * @return bool Whether there's an entry for the given word in the map. + */ + public function contains($word, $case_sensitivity = 'case-sensitive') + { + } + /** + * If the text starting at a given offset is a lookup key in the map, + * return the corresponding transformation from the map, else `false`. + * + * This function returns the translated string, but accepts an optional + * parameter `$matched_token_byte_length`, which communicates how many + * bytes long the lookup key was, if it found one. This can be used to + * advance a cursor in calling code if a lookup key was found. + * + * Example: + * + * false === $smilies->read_token( 'Not sure :?.', 0, $token_byte_length ); + * '😕' === $smilies->read_token( 'Not sure :?.', 9, $token_byte_length ); + * 2 === $token_byte_length; + * + * Example: + * + * while ( $at < strlen( $input ) ) { + * $next_at = strpos( $input, ':', $at ); + * if ( false === $next_at ) { + * break; + * } + * + * $smily = $smilies->read_token( $input, $next_at, $token_byte_length ); + * if ( false === $next_at ) { + * ++$at; + * continue; + * } + * + * $prefix = substr( $input, $at, $next_at - $at ); + * $at += $token_byte_length; + * $output .= "{$prefix}{$smily}"; + * } + * + * @since 6.6.0 + * + * @param string $text String in which to search for a lookup key. + * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0. + * @param ?int &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null. + * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. + * @return string|null Mapped value of lookup key if found, otherwise `null`. + */ + public function read_token($text, $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive') + { + } + /** + * Exports the token map into an associate array of key/value pairs. + * + * Example: + * + * $smilies->to_array() === array( + * '8O' => '😯', + * ':(' => '🙁', + * ':)' => '🙂', + * ':?' => '😕', + * ); + * + * @return array The lookup key/substitution values as an associate array. + */ + public function to_array() + { + } + /** + * Export the token map for quick loading in PHP source code. + * + * This function has a specific purpose, to make loading of static token maps fast. + * It's used to ensure that the HTML character reference lookups add a minimal cost + * to initializing the PHP process. + * + * Example: + * + * echo $smilies->precomputed_php_source_table(); + * + * // Output. + * WP_Token_Map::from_precomputed_table( + * array( + * "storage_version" => "6.6.0", + * "key_length" => 2, + * "groups" => "", + * "long_words" => array(), + * "small_words" => "8O\x00:)\x00:(\x00:?\x00", + * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) + * ) + * ); + * + * @since 6.6.0 + * + * @param string $indent Optional. Use this string for indentation, or rely on the default horizontal tab character. Default "\t". + * @return string Value which can be pasted into a PHP source file for quick loading of table. + */ + public function precomputed_php_source_table($indent = "\t") + { + } + } /** * Session API: WP_User_Meta_Session_Tokens class * @@ -54920,6 +55598,7 @@ public static function fill_query_vars($args) * @since 5.1.0 Introduced the 'meta_compare_key' parameter. * @since 5.3.0 Introduced the 'meta_type_key' parameter. * @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters. + * Deprecated the 'who' parameter. * @since 6.3.0 Added 'cache_results' parameter. * * @global wpdb $wpdb WordPress database abstraction object. @@ -54929,13 +55608,13 @@ public static function fill_query_vars($args) * Optional. Array or string of query parameters. * * @type int $blog_id The site ID. Default is the current site. - * @type string|string[] $role An array or a comma-separated list of role names that users must match - * to be included in results. Note that this is an inclusive list: users - * must match *each* role. Default empty. - * @type string[] $role__in An array of role names. Matched users must have at least one of these - * roles. Default empty array. - * @type string[] $role__not_in An array of role names to exclude. Users matching one or more of these - * roles will not be included in results. Default empty array. + * @type string|string[] $role An array or a comma-separated list of role names that users + * must match to be included in results. Note that this is + * an inclusive list: users must match *each* role. Default empty. + * @type string[] $role__in An array of role names. Matched users must have at least one + * of these roles. Default empty array. + * @type string[] $role__not_in An array of role names to exclude. Users matching one or more + * of these roles will not be included in results. Default empty array. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. @@ -54948,19 +55627,19 @@ public static function fill_query_vars($args) * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. - * @type string|string[] $capability An array or a comma-separated list of capability names that users must match - * to be included in results. Note that this is an inclusive list: users - * must match *each* capability. - * Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}. - * Default empty. - * @type string[] $capability__in An array of capability names. Matched users must have at least one of these - * capabilities. - * Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}. - * Default empty array. - * @type string[] $capability__not_in An array of capability names to exclude. Users matching one or more of these - * capabilities will not be included in results. - * Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}. - * Default empty array. + * @type string|string[] $capability An array or a comma-separated list of capability names that users + * must match to be included in results. Note that this is + * an inclusive list: users must match *each* capability. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty. + * @type string[] $capability__in An array of capability names. Matched users must have at least one + * of these capabilities. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty array. + * @type string[] $capability__not_in An array of capability names to exclude. Users matching one or more + * of these capabilities will not be included in results. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty array. * @type int[] $include An array of user IDs to include. Default empty array. * @type int[] $exclude An array of user IDs to exclude. Default empty array. * @type string $search Search keyword. Searches for possible string matches on columns. @@ -54977,13 +55656,13 @@ public static function fill_query_vars($args) * - 'include' * - 'user_login' (or 'login') * - 'login__in' - * - 'user_nicename' (or 'nicename'), + * - 'user_nicename' (or 'nicename') * - 'nicename__in' * - 'user_email (or 'email') - * - 'user_url' (or 'url'), + * - 'user_url' (or 'url') * - 'user_registered' (or 'registered') * - 'post_count' - * - 'meta_value', + * - 'meta_value' * - 'meta_value_num' * - The value of `$meta_key` * - An array key of `$meta_query` @@ -55020,7 +55699,8 @@ public static function fill_query_vars($args) * - 'all' for all fields and loads user meta. * - 'all_with_meta' Deprecated. Use 'all'. * Default 'all'. - * @type string $who Type of users to query. Accepts 'authors'. + * @type string $who Deprecated, use `$capability` instead. + * Type of users to query. Accepts 'authors'. * Default empty (all users). * @type bool|string[] $has_published_posts Pass an array of post types to filter results to users who have * published posts in those post types. `true` is an alias for all @@ -60677,6 +61357,7 @@ public function get_charset_collate() * @since 4.1.0 Added support for the 'utf8mb4' feature. * @since 4.6.0 Added support for the 'utf8mb4_520' feature. * @since 6.2.0 Added support for the 'identifier_placeholders' feature. + * @since 6.6.0 The `utf8mb4` feature now always returns true. * * @see wpdb::db_version() * @@ -63883,6 +64564,24 @@ public function __construct() * @param array[][] $fonts Optional. The font-families and their font variations. * See {@see wp_print_font_faces()} for the supported fields. * Default empty array. + * @phpstan-param array[], + * }> $fonts See wp_print_font_faces() * @phpstan-return void */ public function generate_and_print(array $fonts) @@ -64073,7 +64772,7 @@ public static function sanitize_from_schema($tree, $schema) * * @access private * - * @return array A collection of mime types keyed by file extension. + * @return string[] A collection of mime types keyed by file extension. */ public static function get_allowed_font_mime_types() { @@ -64318,6 +65017,164 @@ public function __construct($name, $value_start, $value_length, $start, $length, { } } + /** + * HTML API: WP_HTML_Decoder class + * + * Decodes spans of raw text found inside HTML content. + * + * @package WordPress + * @subpackage HTML-API + * @since 6.6.0 + */ + class WP_HTML_Decoder + { + /** + * Indicates if an attribute value starts with a given raw string value. + * + * Use this method to determine if an attribute value starts with a given string, regardless + * of how it might be encoded in HTML. For instance, `http:` could be represented as `http:` + * or as `http:` or as `http:` or as `http:`, or in many other ways. + * + * Example: + * + * $value = 'http://wordpress.org/'; + * true === WP_HTML_Decoder::attribute_starts_with( $value, 'http:', 'ascii-case-insensitive' ); + * false === WP_HTML_Decoder::attribute_starts_with( $value, 'https:', 'ascii-case-insensitive' ); + * + * @since 6.6.0 + * + * @param string $haystack String containing the raw non-decoded attribute value. + * @param string $search_text Does the attribute value start with this plain string. + * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. + * Default 'case-sensitive'. + * @return bool Whether the attribute value starts with the given string. + */ + public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive') + { + } + /** + * Returns a string containing the decoded value of a given HTML text node. + * + * Text nodes appear in HTML DATA sections, which are the text segments inside + * and around tags, excepting SCRIPT and STYLE elements (and some others), + * whose inner text is not decoded. Use this function to read the decoded + * value of such a text span in an HTML document. + * + * Example: + * + * '“😄”' === WP_HTML_Decode::decode_text_node( '“😄”' ); + * + * @since 6.6.0 + * + * @param string $text Text containing raw and non-decoded text node to decode. + * @return string Decoded UTF-8 value of given text node. + */ + public static function decode_text_node($text) + { + } + /** + * Returns a string containing the decoded value of a given HTML attribute. + * + * Text found inside an HTML attribute has different parsing rules than for + * text found inside other markup, or DATA segments. Use this function to + * read the decoded value of an HTML string inside a quoted attribute. + * + * Example: + * + * '“😄”' === WP_HTML_Decode::decode_attribute( '“😄”' ); + * + * @since 6.6.0 + * + * @param string $text Text containing raw and non-decoded attribute value to decode. + * @return string Decoded UTF-8 value of given attribute value. + */ + public static function decode_attribute($text) + { + } + /** + * Decodes a span of HTML text, depending on the context in which it's found. + * + * This is a low-level method; prefer calling WP_HTML_Decoder::decode_attribute() or + * WP_HTML_Decoder::decode_text_node() instead. It's provided for cases where this + * may be difficult to do from calling code. + * + * Example: + * + * '©' = WP_HTML_Decoder::decode( 'data', '©' ); + * + * @since 6.6.0 + * + * @access private + * + * @param string $context `attribute` for decoding attribute values, `data` otherwise. + * @param string $text Text document containing span of text to decode. + * @return string Decoded UTF-8 string. + */ + public static function decode($context, $text) + { + } + /** + * Attempt to read a character reference at the given location in a given string, + * depending on the context in which it's found. + * + * If a character reference is found, this function will return the translated value + * that the reference maps to. It will then set `$match_byte_length` the + * number of bytes of input it read while consuming the character reference. This + * gives calling code the opportunity to advance its cursor when traversing a string + * and decoding. + * + * Example: + * + * null === WP_HTML_Decoder::read_character_reference( 'attribute', 'Ships…', 0 ); + * '…' === WP_HTML_Decoder::read_character_reference( 'attribute', 'Ships…', 5, $token_length ); + * 8 === $token_length; // `…` + * + * null === WP_HTML_Decoder::read_character_reference( 'attribute', '¬in', 0 ); + * '∉' === WP_HTML_Decoder::read_character_reference( 'attribute', '∉', 0, $token_length ); + * 7 === $token_length; // `∉` + * + * '¬' === WP_HTML_Decoder::read_character_reference( 'data', '¬in', 0, $token_length ); + * 4 === $token_length; // `¬` + * '∉' === WP_HTML_Decoder::read_character_reference( 'data', '∉', 0, $token_length ); + * 7 === $token_length; // `∉` + * + * @since 6.6.0 + * + * @param string $context `attribute` for decoding attribute values, `data` otherwise. + * @param string $text Text document containing span of text to decode. + * @param int $at Optional. Byte offset into text where span begins, defaults to the beginning (0). + * @param int &$match_byte_length Optional. Set to byte-length of character reference if provided and if a match + * is found, otherwise not set. Default null. + * @return string|false Decoded character reference in UTF-8 if found, otherwise `false`. + */ + public static function read_character_reference($context, $text, $at = 0, &$match_byte_length = \null) + { + } + /** + * Encode a code point number into the UTF-8 encoding. + * + * This encoder implements the UTF-8 encoding algorithm for converting + * a code point into a byte sequence. If it receives an invalid code + * point it will return the Unicode Replacement Character U+FFFD `�`. + * + * Example: + * + * '🅰' === WP_HTML_Decoder::code_point_to_utf8_bytes( 0x1f170 ); + * + * // Half of a surrogate pair is an invalid code point. + * '�' === WP_HTML_Decoder::code_point_to_utf8_bytes( 0xd83c ); + * + * @since 6.6.0 + * + * @see https://www.rfc-editor.org/rfc/rfc3629 For the UTF-8 standard. + * + * @param int $code_point Which code point to convert. + * @return string Converted code point, or `�` if invalid. + */ + public static function code_point_to_utf8_bytes($code_point) + { + } + } /** * HTML API: WP_HTML_Open_Elements class * @@ -64355,6 +65212,32 @@ class WP_HTML_Open_Elements * @var WP_HTML_Token[] */ public $stack = array(); + /** + * Sets a pop handler that will be called when an item is popped off the stack of + * open elements. + * + * The function will be called with the pushed item as its argument. + * + * @since 6.6.0 + * + * @param Closure $handler The handler function. + */ + public function set_pop_handler(\Closure $handler) + { + } + /** + * Sets a push handler that will be called when an item is pushed onto the stack of + * open elements. + * + * The function will be called with the pushed item as its argument. + * + * @since 6.6.0 + * + * @param Closure $handler The handler function. + */ + public function set_push_handler(\Closure $handler) + { + } /** * Reports if a specific node is in the stack of open elements. * @@ -64618,6 +65501,14 @@ public function after_element_push($item) public function after_element_pop($item) { } + /** + * Wakeup magic method. + * + * @since 6.6.0 + */ + public function __wakeup() + { + } } /** * HTML API: WP_HTML_Processor_State class @@ -64767,10 +65658,6 @@ public function __construct() * - Prune the whitespace when removing classes/attributes: e.g. "a b c" -> "c" not " c". * This would increase the size of the changes for some operations but leave more * natural-looking output HTML. - * - Properly decode HTML character references in `get_attribute()`. PHP's - * `html_entity_decode()` is wrong in a couple ways: it doesn't account for the - * no-ambiguous-ampersand rule, and it improperly handles the way semicolons may - * or may not terminate a character reference. * * @package WordPress * @subpackage HTML-API @@ -65049,8 +65936,8 @@ public function __construct() * * The special elements are: * - `SCRIPT` whose contents are treated as raw plaintext but supports a legacy - * style of including Javascript inside of HTML comments to avoid accidentally - * closing the SCRIPT from inside a Javascript string. E.g. `console.log( '' )`. + * style of including JavaScript inside of HTML comments to avoid accidentally + * closing the SCRIPT from inside a JavaScript string. E.g. `console.log( '' )`. * - `TITLE` and `TEXTAREA` whose contents are treated as plaintext and then any * character references are decoded. E.g. `1 < 2 < 3` becomes `1 < 2 < 3`. * - `IFRAME`, `NOSCRIPT`, `NOEMBED`, `NOFRAME`, `STYLE` whose contents are treated as @@ -66176,11 +67063,12 @@ class WP_HTML_Processor extends \WP_HTML_Tag_Processor * - The only supported document encoding is `UTF-8`, which is the default value. * * @since 6.4.0 + * @since 6.6.0 Returns `static` instead of `self` so it can create subclass instances. * * @param string $html Input HTML fragment to process. * @param string $context Context element for the fragment, must be default of ``. * @param string $encoding Text encoding of the document; must be default of 'UTF-8'. - * @return WP_HTML_Processor|null The created processor if successful, otherwise null. + * @return static|null The created processor if successful, otherwise null. */ public static function create_fragment($html, $context = '', $encoding = 'UTF-8') { @@ -66234,6 +67122,7 @@ public function get_last_error() * @todo Support matching the class name and tag name. * * @since 6.4.0 + * @since 6.6.0 Visits all tokens, including virtual ones. * * @throws Exception When unable to allocate a bookmark for the next token in the input HTML document. * @@ -66241,6 +67130,7 @@ public function get_last_error() * Optional. Which tag name to find, having which class, etc. Default is to find any tag. * * @type string|null $tag_name Which tag to find, or `null` for "any tag." + * @type string $tag_closers 'visit' to pause at tag closers, 'skip' or unset to only visit openers. * @type int|null $match_offset Find the Nth tag matching all search criteria. * 1 for "first" tag, 3 for "third," etc. * Defaults to first tag. @@ -66251,6 +67141,7 @@ public function get_last_error() * @return bool Whether a tag was matched. * @phpstan-param null|array{ * tag_name?: string|null, + * tag_closers?: string, * match_offset?: int|null, * class_name?: string|null, * breadcrumbs?: string[], @@ -66276,6 +67167,25 @@ public function next_tag($query = \null) public function next_token() { } + /** + * Indicates if the current tag token is a tag closer. + * + * Example: + * + * $p = WP_HTML_Processor::create_fragment( '
' ); + * $p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); + * $p->is_tag_closer() === false; + * + * $p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); + * $p->is_tag_closer() === true; + * + * @since 6.6.0 Subclassed for HTML Processor. + * + * @return bool Whether the current tag is a tag closer. + */ + public function is_tag_closer() + { + } /** * Indicates if the currently-matched tag matches the given breadcrumbs. * @@ -66304,6 +67214,30 @@ public function next_token() public function matches_breadcrumbs($breadcrumbs) { } + /** + * Indicates if the currently-matched node expects a closing + * token, or if it will self-close on the next step. + * + * Most HTML elements expect a closer, such as a P element or + * a DIV element. Others, like an IMG element are void and don't + * have a closing tag. Special elements, such as SCRIPT and STYLE, + * are treated just like void tags. Text nodes and self-closing + * foreign content will also act just like a void tag, immediately + * closing as soon as the processor advances to the next token. + * + * @since 6.6.0 + * + * @todo When adding support for foreign content, ensure that + * this returns false for self-closing elements in the + * SVG and MathML namespace. + * + * @param ?WP_HTML_Token $node Node to examine instead of current node, if provided. + * @return bool Whether to expect a closer for the currently-matched node, + * or `null` if not matched on any token. + */ + public function expects_closer($node = \null) + { + } /** * Steps through the HTML document and stop at the next tag, if any. * @@ -66343,6 +67277,34 @@ public function step($node_to_process = self::PROCESS_NEXT_NODE) public function get_breadcrumbs() { } + /** + * Returns the nesting depth of the current location in the document. + * + * Example: + * + * $processor = WP_HTML_Processor::create_fragment( '

' ); + * // The processor starts in the BODY context, meaning it has depth from the start: HTML > BODY. + * 2 === $processor->get_current_depth(); + * + * // Opening the DIV element increases the depth. + * $processor->next_token(); + * 3 === $processor->get_current_depth(); + * + * // Opening the P element increases the depth. + * $processor->next_token(); + * 4 === $processor->get_current_depth(); + * + * // The P element is closed during `next_token()` so the depth is decreased to reflect that. + * $processor->next_token(); + * 3 === $processor->get_current_depth(); + * + * @since 6.6.0 + * + * @return int Nesting-depth of current location in the document. + */ + public function get_current_depth() + { + } /* * HTML semantic overrides for Tag Processor */ @@ -66370,6 +67332,251 @@ public function get_breadcrumbs() public function get_tag() { } + /** + * Indicates if the currently matched tag contains the self-closing flag. + * + * No HTML elements ought to have the self-closing flag and for those, the self-closing + * flag will be ignored. For void elements this is benign because they "self close" + * automatically. For non-void HTML elements though problems will appear if someone + * intends to use a self-closing element in place of that element with an empty body. + * For HTML foreign elements and custom elements the self-closing flag determines if + * they self-close or not. + * + * This function does not determine if a tag is self-closing, + * but only if the self-closing flag is present in the syntax. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @return bool Whether the currently matched tag contains the self-closing flag. + */ + public function has_self_closing_flag() + { + } + /** + * Returns the node name represented by the token. + * + * This matches the DOM API value `nodeName`. Some values + * are static, such as `#text` for a text node, while others + * are dynamically generated from the token itself. + * + * Dynamic names: + * - Uppercase tag name for tag matches. + * - `html` for DOCTYPE declarations. + * + * Note that if the Tag Processor is not matched on a token + * then this function will return `null`, either because it + * hasn't yet found a token or because it reached the end + * of the document without matching a token. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @return string|null Name of the matched token. + */ + public function get_token_name() + { + } + /** + * Indicates the kind of matched token, if any. + * + * This differs from `get_token_name()` in that it always + * returns a static string indicating the type, whereas + * `get_token_name()` may return values derived from the + * token itself, such as a tag name or processing + * instruction tag. + * + * Possible values: + * - `#tag` when matched on a tag. + * - `#text` when matched on a text node. + * - `#cdata-section` when matched on a CDATA node. + * - `#comment` when matched on a comment. + * - `#doctype` when matched on a DOCTYPE declaration. + * - `#presumptuous-tag` when matched on an empty tag closer. + * - `#funky-comment` when matched on a funky comment. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @return string|null What kind of token is matched, or null. + */ + public function get_token_type() + { + } + /** + * Returns the value of a requested attribute from a matched tag opener if that attribute exists. + * + * Example: + * + * $p = WP_HTML_Processor::create_fragment( '
Test
' ); + * $p->next_token() === true; + * $p->get_attribute( 'data-test-id' ) === '14'; + * $p->get_attribute( 'enabled' ) === true; + * $p->get_attribute( 'aria-label' ) === null; + * + * $p->next_tag() === false; + * $p->get_attribute( 'class' ) === null; + * + * @since 6.6.0 Subclassed for HTML Processor. + * + * @param string $name Name of attribute whose value is requested. + * @return string|true|null Value of attribute or `null` if not available. Boolean attributes return `true`. + */ + public function get_attribute($name) + { + } + /** + * Updates or creates a new attribute on the currently matched tag with the passed value. + * + * For boolean attributes special handling is provided: + * - When `true` is passed as the value, then only the attribute name is added to the tag. + * - When `false` is passed, the attribute gets removed if it existed before. + * + * For string attributes, the value is escaped using the `esc_attr` function. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @param string $name The attribute name to target. + * @param string|bool $value The new attribute value. + * @return bool Whether an attribute value was set. + */ + public function set_attribute($name, $value) + { + } + /** + * Remove an attribute from the currently-matched tag. + * + * @since 6.6.0 Subclassed for HTML Processor. + * + * @param string $name The attribute name to remove. + * @return bool Whether an attribute was removed. + */ + public function remove_attribute($name) + { + } + /** + * Gets lowercase names of all attributes matching a given prefix in the current tag. + * + * Note that matching is case-insensitive. This is in accordance with the spec: + * + * > There must never be two or more attributes on + * > the same start tag whose names are an ASCII + * > case-insensitive match for each other. + * - HTML 5 spec + * + * Example: + * + * $p = new WP_HTML_Tag_Processor( '
Test
' ); + * $p->next_tag( array( 'class_name' => 'test' ) ) === true; + * $p->get_attribute_names_with_prefix( 'data-' ) === array( 'data-enabled', 'data-test-id' ); + * + * $p->next_tag() === false; + * $p->get_attribute_names_with_prefix( 'data-' ) === null; + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive + * + * @param string $prefix Prefix of requested attribute names. + * @return array|null List of attribute names, or `null` when no tag opener is matched. + */ + public function get_attribute_names_with_prefix($prefix) + { + } + /** + * Adds a new class name to the currently matched tag. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @param string $class_name The class name to add. + * @return bool Whether the class was set to be added. + */ + public function add_class($class_name) + { + } + /** + * Removes a class name from the currently matched tag. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @param string $class_name The class name to remove. + * @return bool Whether the class was set to be removed. + */ + public function remove_class($class_name) + { + } + /** + * Returns if a matched tag contains the given ASCII case-insensitive class name. + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @param string $wanted_class Look for this CSS class name, ASCII case-insensitive. + * @return bool|null Whether the matched tag contains the given class name, or null if not matched. + */ + public function has_class($wanted_class) + { + } + /** + * Generator for a foreach loop to step through each class name for the matched tag. + * + * This generator function is designed to be used inside a "foreach" loop. + * + * Example: + * + * $p = WP_HTML_Processor::create_fragment( "
" ); + * $p->next_tag(); + * foreach ( $p->class_list() as $class_name ) { + * echo "{$class_name} "; + * } + * // Outputs: "free lang-en " + * + * @since 6.6.0 Subclassed for the HTML Processor. + */ + public function class_list() + { + } + /** + * Returns the modifiable text for a matched token, or an empty string. + * + * Modifiable text is text content that may be read and changed without + * changing the HTML structure of the document around it. This includes + * the contents of `#text` nodes in the HTML as well as the inner + * contents of HTML comments, Processing Instructions, and others, even + * though these nodes aren't part of a parsed DOM tree. They also contain + * the contents of SCRIPT and STYLE tags, of TEXTAREA tags, and of any + * other section in an HTML document which cannot contain HTML markup (DATA). + * + * If a token has no modifiable text then an empty string is returned to + * avoid needless crashing or type errors. An empty string does not mean + * that a token has modifiable text, and a token with modifiable text may + * have an empty string (e.g. a comment with no contents). + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @return string + */ + public function get_modifiable_text() + { + } + /** + * Indicates what kind of comment produced the comment node. + * + * Because there are different kinds of HTML syntax which produce + * comments, the Tag Processor tracks and exposes this as a type + * for the comment. Nominally only regular HTML comments exist as + * they are commonly known, but a number of unrelated syntax errors + * also produce comments. + * + * @see self::COMMENT_AS_ABRUPTLY_CLOSED_COMMENT + * @see self::COMMENT_AS_CDATA_LOOKALIKE + * @see self::COMMENT_AS_INVALID_HTML + * @see self::COMMENT_AS_HTML_COMMENT + * @see self::COMMENT_AS_PI_NODE_LOOKALIKE + * + * @since 6.6.0 Subclassed for the HTML Processor. + * + * @return string|null + */ + public function get_comment_type() + { + } /** * Removes a bookmark that is no longer needed. * @@ -66638,6 +67845,80 @@ public function __construct($start, $length) { } } + /** + * HTML API: WP_HTML_Stack_Event class + * + * @package WordPress + * @subpackage HTML-API + * @since 6.6.0 + */ + /** + * Core class used by the HTML Processor as a record for stack operations. + * + * This class is for internal usage of the WP_HTML_Processor class. + * + * @access private + * @since 6.6.0 + * + * @see WP_HTML_Processor + */ + class WP_HTML_Stack_Event + { + /** + * Refers to popping an element off of the stack of open elements. + * + * @since 6.6.0 + */ + const POP = 'pop'; + /** + * Refers to pushing an element onto the stack of open elements. + * + * @since 6.6.0 + */ + const PUSH = 'push'; + /** + * References the token associated with the stack push event, + * even if this is a pop event for that element. + * + * @since 6.6.0 + * + * @var WP_HTML_Token + */ + public $token; + /** + * Indicates which kind of stack operation this event represents. + * + * May be one of the class constants. + * + * @since 6.6.0 + * + * @see self::POP + * @see self::PUSH + * + * @var string + */ + public $operation; + /** + * Indicates if the stack element is a real or virtual node. + * + * @since 6.6.0 + * + * @var string + */ + public $provenance; + /** + * Constructor function. + * + * @since 6.6.0 + * + * @param WP_HTML_Token $token Token associated with stack event, always an opening token. + * @param string $operation One of self::PUSH or self::POP. + * @param string $provenance "virtual" or "real". + */ + public function __construct($token, $operation, $provenance) + { + } + } /** * HTML API: WP_HTML_Text_Replacement class * @@ -66956,15 +68237,19 @@ final class WP_Interactivity_API * If state for that store namespace already exists, it merges the new * provided state with the existing one. * + * When no namespace is specified, it returns the state defined for the + * current value in the internal namespace stack during a `process_directives` call. + * * @since 6.5.0 + * @since 6.6.0 The `$store_namespace` param is optional. * - * @param string $store_namespace The unique store namespace identifier. + * @param string $store_namespace Optional. The unique store namespace identifier. * @param array $state Optional. The array that will be merged with the existing state for the specified * store namespace. * @return array The current state for the specified store namespace. This will be the updated state if a $state * argument was provided. */ - public function state(string $store_namespace, array $state = array()) : array + public function state(?string $store_namespace = \null, ?array $state = \null) : array { } /** @@ -66999,6 +68284,19 @@ public function config(string $store_namespace, array $config = array()) : array public function print_client_interactivity_data() { } + /** + * Returns the latest value on the context stack with the passed namespace. + * + * When the namespace is omitted, it uses the current namespace on the + * namespace stack during a `process_directives` call. + * + * @since 6.6.0 + * + * @param string $store_namespace Optional. The unique store namespace identifier. + */ + public function get_context(?string $store_namespace = \null) : array + { + } /** * Registers the `@wordpress/interactivity` script modules. * @@ -67097,7 +68395,7 @@ public function set_locale(string $locale) * @param string $locale Optional. Locale. Default current locale. * @return bool True on success, false otherwise. */ - public function load_file(string $translation_file, string $textdomain = 'default', string $locale = \null) : bool + public function load_file(string $translation_file, string $textdomain = 'default', ?string $locale = \null) : bool { } /** @@ -67110,7 +68408,7 @@ public function load_file(string $translation_file, string $textdomain = 'defaul * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ - public function unload_file($file, string $textdomain = 'default', string $locale = \null) : bool + public function unload_file($file, string $textdomain = 'default', ?string $locale = \null) : bool { } /** @@ -67122,7 +68420,7 @@ public function unload_file($file, string $textdomain = 'default', string $local * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ - public function unload_textdomain(string $textdomain = 'default', string $locale = \null) : bool + public function unload_textdomain(string $textdomain = 'default', ?string $locale = \null) : bool { } /** @@ -67134,7 +68432,7 @@ public function unload_textdomain(string $textdomain = 'default', string $locale * @param string $locale Optional. Locale. Default current locale. * @return bool True if there are any loaded translations, false otherwise. */ - public function is_textdomain_loaded(string $textdomain = 'default', string $locale = \null) : bool + public function is_textdomain_loaded(string $textdomain = 'default', ?string $locale = \null) : bool { } /** @@ -67148,7 +68446,7 @@ public function is_textdomain_loaded(string $textdomain = 'default', string $loc * @param string $locale Optional. Locale. Default current locale. * @return string|false Translation on success, false otherwise. */ - public function translate(string $text, string $context = '', string $textdomain = 'default', string $locale = \null) + public function translate(string $text, string $context = '', string $textdomain = 'default', ?string $locale = \null) { } /** @@ -67159,23 +68457,23 @@ public function translate(string $text, string $context = '', string $textdomain * * @since 6.5.0 * - * @param array{0: string, 1: string} $plurals { + * @param array $plurals { * Pair of singular and plural translations. * * @type string $0 Singular translation. * @type string $1 Plural translation. * } - * @param int $number Number of items. - * @param string $context Optional. Context for the string. Default empty string. - * @param string $textdomain Optional. Text domain. Default 'default'. - * @param string $locale Optional. Locale. Default current locale. + * @param int $number Number of items. + * @param string $context Optional. Context for the string. Default empty string. + * @param string $textdomain Optional. Text domain. Default 'default'. + * @param string|null $locale Optional. Locale. Default current locale. * @return string|false Translation on success, false otherwise. - * @phpstan-param array{0: string, 1: string}{ + * @phpstan-param array{ * 0: string, * 1: string, * } $plurals */ - public function translate_plural(array $plurals, int $number, string $context = '', string $textdomain = 'default', string $locale = \null) + public function translate_plural(array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = \null) { } /** @@ -67276,7 +68574,7 @@ protected function __construct(string $file) * @param string|null $filetype Optional. File type. Default inferred from file name. * @return false|WP_Translation_File */ - public static function create(string $file, string $filetype = \null) + public static function create(string $file, ?string $filetype = \null) { } /** @@ -71375,12 +72673,14 @@ public function get_item_schema() * Handles an upload via raw POST data. * * @since 4.7.0 + * @since 6.6.0 Added the `$time` parameter. * - * @param string $data Supplied file data. - * @param array $headers HTTP headers from the request. + * @param string $data Supplied file data. + * @param array $headers HTTP headers from the request. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array|WP_Error Data from wp_handle_sideload(). */ - protected function upload_from_data($data, $headers) + protected function upload_from_data($data, $headers, $time = \null) { } /** @@ -71429,12 +72729,14 @@ public function get_collection_params() * Handles an upload via multipart/form-data ($_FILES). * * @since 4.7.0 + * @since 6.6.0 Added the `$time` parameter. * - * @param array $files Data from the `$_FILES` superglobal. - * @param array $headers HTTP headers from the request. + * @param array $files Data from the `$_FILES` superglobal. + * @param array $headers HTTP headers from the request. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array|WP_Error Data from wp_handle_upload(). */ - protected function upload_from_file($files, $headers) + protected function upload_from_file($files, $headers, $time = \null) { } /** @@ -72904,7 +74206,7 @@ class WP_REST_Font_Faces_Controller extends \WP_REST_Posts_Controller * @since 6.5.0 * @var int */ - const LATEST_THEME_JSON_VERSION_SUPPORTED = 2; + const LATEST_THEME_JSON_VERSION_SUPPORTED = 3; /** * Whether the controller supports batching. * @@ -73176,7 +74478,7 @@ class WP_REST_Font_Families_Controller extends \WP_REST_Posts_Controller * @since 6.5.0 * @var int */ - const LATEST_THEME_JSON_VERSION_SUPPORTED = 2; + const LATEST_THEME_JSON_VERSION_SUPPORTED = 3; /** * Whether the controller supports batching. * @@ -73367,20 +74669,23 @@ protected function get_settings_from_post($post) /** * Base Global Styles REST API Controller. */ - class WP_REST_Global_Styles_Controller extends \WP_REST_Controller + class WP_REST_Global_Styles_Controller extends \WP_REST_Posts_Controller { /** - * Post type. + * Whether the controller supports batching. * - * @since 5.9.0 - * @var string + * @since 6.6.0 + * @var array */ - protected $post_type; + protected $allow_batch = array('v1' => \false); /** * Constructor. - * @since 5.9.0 + * + * @since 6.6.0 + * + * @param string $post_type Post type. */ - public function __construct() + public function __construct($post_type = 'wp_global_styles') { } /** @@ -73434,19 +74739,7 @@ public function get_item_permissions_check($request) * @param WP_Post $post Post object. * @return bool Whether the post can be read. */ - protected function check_read_permission($post) - { - } - /** - * Returns the given global styles config. - * - * @since 5.9.0 - * - * @param WP_REST_Request $request The request instance. - * - * @return WP_REST_Response|WP_Error - */ - public function get_item($request) + public function check_read_permission($post) { } /** @@ -73460,33 +74753,12 @@ public function get_item($request) public function update_item_permissions_check($request) { } - /** - * Checks if a global style can be edited. - * - * @since 5.9.0 - * - * @param WP_Post $post Post object. - * @return bool Whether the post can be edited. - */ - protected function check_update_permission($post) - { - } - /** - * Updates a single global style config. - * - * @since 5.9.0 - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. - */ - public function update_item($request) - { - } /** * Prepares a single global styles config for update. * * @since 5.9.0 * @since 6.2.0 Added validation of styles.css property. + * @since 6.6.0 Added registration of block style variations from theme.json sources (theme.json, user theme.json, partials). * * @param WP_REST_Request $request Request object. * @return stdClass|WP_Error Prepared item on success. WP_Error on when the custom CSS is not valid. @@ -73498,6 +74770,7 @@ protected function prepare_item_for_database($request) * Prepare a global styles config output for response. * * @since 5.9.0 + * @since 6.6.0 Added custom relative theme file URIs to `_links`. * * @param WP_Post $post Global Styles post object. * @param WP_REST_Request $request Request object. @@ -73523,24 +74796,13 @@ protected function prepare_links($id) * * @since 5.9.0 * @since 6.2.0 Added 'edit-css' action. + * @since 6.6.0 Added $post and $request parameters. * + * @param WP_Post $post Post object. + * @param WP_REST_Request $request Request object. * @return array List of link relations. */ - protected function get_available_actions() - { - } - /** - * Overwrites the default protected title format. - * - * By default, WordPress will show password protected posts with a title of - * "Protected: %s", as the REST API communicates the protected status of a post - * in a machine readable format, we remove the "Protected: " prefix. - * - * @since 5.9.0 - * - * @return string Protected title format. - */ - public function protected_title_format() + protected function get_available_actions($post, $request) { } /** @@ -73578,6 +74840,7 @@ public function get_theme_item_permissions_check($request) * Returns the given theme global styles config. * * @since 5.9.0 + * @since 6.6.0 Added custom relative theme file URIs to `_links`. * * @param WP_REST_Request $request The request instance. * @return WP_REST_Response|WP_Error @@ -73601,6 +74864,7 @@ public function get_theme_items_permissions_check($request) * * @since 6.0.0 * @since 6.2.0 Returns parent theme variations, if they exist. + * @since 6.6.0 Added custom relative theme file URIs to `_links` for each item. * * @param WP_REST_Request $request The request instance. * @@ -73638,52 +74902,42 @@ protected function validate_custom_css($css) * * @see WP_REST_Controller */ - class WP_REST_Global_Styles_Revisions_Controller extends \WP_REST_Controller + class WP_REST_Global_Styles_Revisions_Controller extends \WP_REST_Revisions_Controller { /** - * Parent post type. + * The base of the parent controller's route. * * @since 6.3.0 * @var string */ - protected $parent_post_type; + protected $parent_base; /** - * The base of the parent controller's route. + * Parent post type. * - * @since 6.3.0 + * @since 6.6.0 * @var string */ - protected $parent_base; + protected $parent_post_type; /** * Constructor. * * @since 6.3.0 + * @since 6.6.0 Extends class from WP_REST_Revisions_Controller. + * + * @param string $parent_post_type Post type of the parent. */ - public function __construct() + public function __construct($parent_post_type = 'wp_global_styles') { } /** * Registers the controller's routes. * * @since 6.3.0 - * @since 6.5.0 Added route to fetch individual global styles revisions. + * @since 6.6.0 Added route to fetch individual global styles revisions. */ public function register_routes() { } - /** - * Retrieves the query params for collections. - * - * Inherits from WP_REST_Controller::get_collection_params(), - * also reflects changes to return value WP_REST_Revisions_Controller::get_collection_params(). - * - * @since 6.3.0 - * - * @return array Collection parameters. - */ - public function get_collection_params() - { - } /** * Returns decoded JSON from post content string, * or a 404 if not found. @@ -73710,47 +74964,11 @@ protected function get_decoded_global_styles_json($raw_json) public function get_items($request) { } - /** - * Retrieves one global styles revision from the collection. - * - * @since 6.5.0 - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. - */ - public function get_item($request) - { - } - /** - * Gets the global styles revision, if the ID is valid. - * - * @since 6.5.0 - * - * @param int $id Supplied ID. - * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise. - */ - protected function get_revision($id) - { - } - /** - * Checks the post_date_gmt or modified_gmt and prepare any post or - * modified date for single post output. - * - * Duplicate of WP_REST_Revisions_Controller::prepare_date_response. - * - * @since 6.3.0 - * - * @param string $date_gmt GMT publication time. - * @param string|null $date Optional. Local publication time. Default null. - * @return string|null ISO8601/RFC3339 formatted datetime, otherwise null. - */ - protected function prepare_date_response($date_gmt, $date = \null) - { - } /** * Prepares the revision for the REST response. * * @since 6.3.0 + * @since 6.6.0 Added resolved URI links to the response. * * @param WP_Post $post Post revision object. * @param WP_REST_Request $request Request object. @@ -73763,6 +74981,7 @@ public function prepare_item_for_response($post, $request) * Retrieves the revision's schema, conforming to JSON Schema. * * @since 6.3.0 + * @since 6.6.0 Merged parent and parent controller schema data. * * @return array Item schema data. */ @@ -73770,27 +74989,14 @@ public function get_item_schema() { } /** - * Checks if a given request has access to read a single global style. - * - * @since 6.3.0 - * - * @param WP_REST_Request $request Full details about the request. - * @return true|WP_Error True if the request has read access, WP_Error object otherwise. - */ - public function get_item_permissions_check($request) - { - } - /** - * Gets the parent post, if the ID is valid. - * - * Duplicate of WP_REST_Revisions_Controller::get_parent. + * Retrieves the query params for collections. + * Removes params that are not supported by global styles revisions. * - * @since 6.3.0 + * @since 6.6.0 * - * @param int $parent_post_id Supplied ID. - * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. + * @return array Collection parameters. */ - protected function get_parent($parent_post_id) + public function get_collection_params() { } } @@ -76157,14 +77363,14 @@ public function register_routes() { } /** - * Gets the parent post, if the ID is valid. + * Gets the parent post, if the template ID is valid. * * @since 6.4.0 * - * @param int $parent_post_id Supplied ID. + * @param string $parent_template_id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ - protected function get_parent($parent_post_id) + protected function get_parent($parent_template_id) { } /** @@ -76300,6 +77506,7 @@ public function _sanitize_template_id($id) * Checks if a given request has access to read templates. * * @since 5.8.0 + * @since 6.6.0 Allow users with edit_posts capability to read templates. * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. @@ -76322,6 +77529,7 @@ public function get_items($request) * Checks if a given request has access to read a single template. * * @since 5.8.0 + * @since 6.6.0 Allow users with edit_posts capability to read individual templates. * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. @@ -76584,6 +77792,7 @@ public function get_items($request) * * @since 5.0.0 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support. + * @since 6.6.0 Added `stylesheet_uri` and `template_uri` fields. * * @param WP_Theme $item Theme object. * @param WP_REST_Request $request Request object. @@ -76752,6 +77961,13 @@ class WP_REST_Users_Controller extends \WP_REST_Controller * @var WP_REST_User_Meta_Fields */ protected $meta; + /** + * Whether the controller supports batching. + * + * @since 6.6.0 + * @var array + */ + protected $allow_batch = array('v1' => \true); /** * Constructor. * @@ -79203,18 +80419,29 @@ class WP_Style_Engine_CSS_Rule * @var WP_Style_Engine_CSS_Declarations */ protected $declarations; + /** + * A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. + * + * @since 6.6.0 + * @var string + */ + protected $rules_group; /** * Constructor. * * @since 6.1.0 + * @since 6.6.0 Added the `$rules_group` parameter. * * @param string $selector Optional. The CSS selector. Default empty string. * @param string[]|WP_Style_Engine_CSS_Declarations $declarations Optional. An associative array of CSS definitions, * e.g. `array( "$property" => "$value", "$property" => "$value" )`, * or a WP_Style_Engine_CSS_Declarations object. * Default empty array. + * @param string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. */ - public function __construct($selector = '', $declarations = array()) + public function __construct($selector = '', $declarations = array(), $rules_group = '') { } /** @@ -79240,6 +80467,28 @@ public function set_selector($selector) public function add_declarations($declarations) { } + /** + * Sets the rules group. + * + * @since 6.6.0 + * + * @param string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. + * @return WP_Style_Engine_CSS_Rule Returns the object to allow chaining of methods. + */ + public function set_rules_group($rules_group) + { + } + /** + * Gets the rules group. + * + * @since 6.6.0 + * + * @return string + */ + public function get_rules_group() + { + } /** * Gets the declarations object. * @@ -79264,6 +80513,7 @@ public function get_selector() * Gets the CSS. * * @since 6.1.0 + * @since 6.6.0 Added support for nested CSS with rules groups. * * @param bool $should_prettify Optional. Whether to add spacing, new lines and indents. * Default false. @@ -79379,12 +80629,15 @@ public function get_all_rules() * If the rule does not exist, it will be created. * * @since 6.1.0 + * @since 6.6.0 Added the $rules_group parameter. * * @param string $selector The CSS selector. + * @param string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. * @return WP_Style_Engine_CSS_Rule|void Returns a WP_Style_Engine_CSS_Rule object, * or void if the selector is empty. */ - public function add_rule($selector) + public function add_rule($selector, $rules_group = '') { } /** @@ -79442,6 +80695,7 @@ public function add_store($store) * Adds rules to be processed. * * @since 6.1.0 + * @since 6.6.0 Added support for rules_group. * * @param WP_Style_Engine_CSS_Rule|WP_Style_Engine_CSS_Rule[] $css_rules A single, or an array of, * WP_Style_Engine_CSS_Rule objects @@ -79529,6 +80783,7 @@ final class WP_Style_Engine * Stores a CSS rule using the provided CSS selector and CSS declarations. * * @since 6.1.0 + * @since 6.6.0 Added the `$rules_group` parameter. * * @param string $store_name A valid store key. * @param string $css_selector When a selector is passed, the function will return @@ -79536,9 +80791,11 @@ final class WP_Style_Engine * otherwise a concatenated string of properties and values. * @param string[] $css_declarations An associative array of CSS definitions, * e.g. `array( "$property" => "$value", "$property" => "$value" )`. + * @param string $rules_group Optional. A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. * @phpstan-return void */ - public static function store_css_rule($store_name, $css_selector, $css_declarations) + public static function store_css_rule($store_name, $css_selector, $css_declarations, $rules_group = '') { } /** @@ -79688,8 +80945,9 @@ public function update($new_instance, $old_instance) * * @since 3.0.0 * - * @param array $instance Current settings. * @global WP_Customize_Manager $wp_customize + * + * @param array $instance Current settings. */ public function form($instance) { @@ -81416,11 +82674,11 @@ function export_add_js() /** * Creates the date options fields for exporting a given post type. * + * @since 3.1.0 + * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Locale $wp_locale WordPress date and time locale object. * - * @since 3.1.0 - * * @param string $post_type The post type. Default 'post'. * @phpstan-return void */ @@ -81492,7 +82750,7 @@ function wp_ajax_imgedit_preview() * * @since 3.1.0 * - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * @phpstan-return never */ function wp_ajax_oembed_cache() @@ -82065,7 +83323,7 @@ function wp_ajax_send_attachment_to_editor() * @since 3.5.0 * * @global WP_Post $post Global post object. - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * @phpstan-return never */ function wp_ajax_send_link_to_editor() @@ -82120,8 +83378,8 @@ function wp_ajax_query_themes() * * @since 4.0.0 * - * @global WP_Post $post Global post object. - * @global WP_Embed $wp_embed Embed API instance. + * @global WP_Post $post Global post object. + * @global WP_Embed $wp_embed WordPress Embed object. * @global WP_Scripts $wp_scripts * @global int $content_width * @phpstan-return never @@ -84305,7 +85563,7 @@ function _wp_handle_upload(&$file, $overrides, $time, $action) * @param array|false $overrides Optional. An associative array of names => values * to override default variables. Default false. * See _wp_handle_upload() for accepted values. - * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array See _wp_handle_upload() for return value. * @phpstan-param array{ * name?: string, @@ -84342,7 +85600,7 @@ function wp_handle_upload(&$file, $overrides = \false, $time = \null) * @param array|false $overrides Optional. An associative array of names => values * to override default variables. Default false. * See _wp_handle_upload() for accepted values. - * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array See _wp_handle_upload() for return value. * @phpstan-param array{ * name?: string, @@ -84578,7 +85836,7 @@ function WP_Filesystem($args = \false, $context = \false, $allow_relaxed_file_ow * The return value can be overridden by defining the `FS_METHOD` constant in `wp-config.php`, * or filtering via {@see 'filesystem_method'}. * - * @link https://wordpress.org/documentation/article/editing-wp-config-php/#wordpress-upgrade-constants + * @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#wordpress-upgrade-constants * * Plugins may define a custom transport handler, See WP_Filesystem(). * @@ -86340,7 +87598,7 @@ function wp_print_plugin_file_tree($tree, $label = '', $level = 2, $size = 1, $i { } /** - * Flushes rewrite rules if siteurl, home or page_on_front changed. + * Flushes rewrite rules if `siteurl`, `home` or `page_on_front` changed. * * @since 2.1.0 * @@ -86352,11 +87610,11 @@ function update_home_siteurl($old_value, $value) { } /** - * Resets global variables based on $_GET and $_POST. + * Resets global variables based on `$_GET` and `$_POST`. * * This function resets global variables based on the names passed - * in the $vars array to the value of $_POST[$var] or $_GET[$var] or '' - * if neither is defined. + * in the `$vars` array to the value of `$_POST[$var]` or `$_GET[$var]` or an + * empty string if neither is defined. * * @since 2.0.0 * @@ -86531,7 +87789,7 @@ function wp_refresh_metabox_loader_nonces($response, $data) { } /** - * Adds the latest Heartbeat and REST-API nonce to the Heartbeat response. + * Adds the latest Heartbeat and REST API nonce to the Heartbeat response. * * @since 5.0.0 * @@ -87058,7 +88316,7 @@ function wp_nav_menu_setup() * * @since 3.0.0 * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * @phpstan-return void */ function wp_initial_nav_menu_meta_boxes() @@ -88462,7 +89720,7 @@ function get_admin_page_parent($parent_page = '') * * @since 1.5.0 * - * @global string $title + * @global string $title The title of the current screen. * @global array $menu * @global array $submenu * @global string $pagenow The filename of the current screen. @@ -88885,7 +90143,7 @@ function get_post_meta_by_id($mid) * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int $postid A post ID. + * @param int $post_id A post ID. * @return array[] { * Array of meta data arrays for the given post ID. * @@ -88905,7 +90163,7 @@ function get_post_meta_by_id($mid) * post_id: string, * }> */ - function has_meta($postid) + function has_meta($post_id) { } /** @@ -88930,7 +90188,7 @@ function update_meta($meta_id, $meta_key, $meta_value) * @since 2.3.0 * @access private * - * @param int|object $post Post ID or post object. + * @param int|WP_Post $post Post ID or post object. * @return void|int|WP_Error Void if nothing fixed. 0 or WP_Error on update failure. The post ID on update success. */ function _fix_attachment_links($post) @@ -89193,7 +90451,7 @@ function get_block_editor_server_block_settings() * * @global WP_Post $post Global post object. * @global WP_Screen $current_screen WordPress current screen object. - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. */ function the_block_editor_meta_boxes() { @@ -89638,7 +90896,7 @@ function get_hidden_columns($screen) * * @since 2.7.0 * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * * @param WP_Screen $screen * @phpstan-return void @@ -90100,7 +91358,7 @@ function wp_import_upload_form($action) * @since 2.5.0 * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs. * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * * @param string $id Meta box ID (used in the 'id' attribute for the meta box). * @param string $title Title of the meta box. @@ -90173,7 +91431,7 @@ function _get_plugin_from_callback($callback) * * @since 2.5.0 * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or * add_submenu_page() to create a new screen (and hence screen_id) @@ -90194,7 +91452,7 @@ function do_meta_boxes($screen, $context, $data_object) * @since 2.6.0 * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs. * - * @global array $wp_meta_boxes + * @global array $wp_meta_boxes Global meta box state. * * @param string $id Meta box ID (used in the 'id' attribute for the meta box). * @param string|array|WP_Screen $screen The screen or screens on which the meta box is shown (such as a @@ -91639,7 +92897,7 @@ function wp_install($blog_title, $user_name, $user_email, $is_public, $deprecate * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Rewrite $wp_rewrite WordPress rewrite component. - * @global string $table_prefix + * @global string $table_prefix The database table prefix. * * @param int $user_id User ID. */ @@ -93091,6 +94349,7 @@ function wp_admin_bar_site_menu($wp_admin_bar) * * @since 5.9.0 * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. + * @since 6.6.0 Added the `canvas` query arg to the Site Editor link. * * @global string $_wp_current_template_id * @@ -93665,25 +94924,25 @@ function __clear_multi_author_cache() * @param array $source_properties { * The array of arguments that are used to register a source. * - * @type string $label The label of the source. - * @type callback $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 array $uses_context (optional) Array of values to add to block `uses_context` needed by the 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. * @phpstan-param array{ * label?: string, - * get_value_callback?: callback, - * uses_context?: array, + * get_value_callback?: callable, + * uses_context?: string[], * } $source_properties */ function register_block_bindings_source(string $source_name, array $source_properties) @@ -93942,6 +95201,7 @@ function get_block_editor_theme_styles() * Returns the classic theme supports settings for block editor. * * @since 6.2.0 + * @since 6.6.0 Add support for 'editor-spacing-sizes' theme support. * * @return array The classic theme supports settings. */ @@ -94083,6 +95343,8 @@ function wp_register_background_support($block_type) * * @since 6.4.0 * @since 6.5.0 Added support for `backgroundPosition` and `backgroundRepeat` output. + * @since 6.6.0 Removed requirement for `backgroundImage.source`. A file/url is the default. + * * @access private * * @param string $block_content Rendered block content. @@ -94092,6 +95354,110 @@ function wp_register_background_support($block_type) function wp_render_background_support($block_content, $block) { } + /** + * Block support to enable per-section styling of block types via + * block style variations. + * + * @package WordPress + * @since 6.6.0 + */ + /** + * Generate block style variation instance name. + * + * @since 6.6.0 + * @access private + * + * @param array $block Block object. + * @param string $variation Slug for the block style variation. + * + * @return string The unique variation name. + */ + function wp_create_block_style_variation_instance_name($block, $variation) + { + } + /** + * Determines the block style variation names within a CSS class string. + * + * @since 6.6.0 + * + * @param string $class_string CSS class string to look for a variation in. + * + * @return array|null The block style variation name if found. + */ + function wp_get_block_style_variation_name_from_class($class_string) + { + } + /** + * Recursively resolves any `ref` values within a block style variation's data. + * + * @since 6.6.0 + * @access private + * + * @param array $variation_data Reference to the variation data being processed. + * @param array $theme_json Theme.json data to retrieve referenced values from. + */ + function wp_resolve_block_style_variation_ref_values(&$variation_data, $theme_json) + { + } + /** + * Render the block style variation's styles. + * + * In the case of nested blocks with variations applied, we want the parent + * variation's styles to be rendered before their descendants. This solves the + * issue of a block type being styled in both the parent and descendant: we want + * the descendant style to take priority, and this is done by loading it after, + * in the DOM order. This is why the variation stylesheet generation is in a + * different filter. + * + * @since 6.6.0 + * @access private + * + * @param array $parsed_block The parsed block. + * + * @return array The parsed block with block style variation classname added. + */ + function wp_render_block_style_variation_support_styles($parsed_block) + { + } + /** + * Ensure the variation block support class name generated and added to + * block attributes in the `render_block_data` filter gets applied to the + * block's markup. + * + * @see wp_render_block_style_variation_support_styles + * + * @since 6.6.0 + * @access private + * + * @param string $block_content Rendered block content. + * @param array $block Block object. + * + * @return string Filtered block content. + */ + function wp_render_block_style_variation_class_name($block_content, $block) + { + } + /** + * Enqueues styles for block style variations. + * + * @since 6.6.0 + * @access private + */ + function wp_enqueue_block_style_variation_styles() + { + } + /** + * Registers block style variations read in from theme.json partials. + * + * @since 6.6.0 + * @access private + * + * @param array $variations Shared block style variations. + * @phpstan-return void + */ + function wp_register_block_style_variations_from_theme_json_partials($variations) + { + } /** * Border block support flag. * @@ -94281,21 +95647,20 @@ function wp_get_elements_class_name($block) { } /** - * Updates the block content with elements class names. + * Determines whether an elements class name should be added to the block. * - * @since 5.8.0 - * @since 6.4.0 Added support for button and heading element styling. + * @since 6.6.0 * @access private * - * @param string $block_content Rendered block content. - * @param array $block Block object. - * @return string Filtered block content. + * @param array $block Block object. + * @param array $options Per element type options e.g. whether to skip serialization. + * @return boolean Whether the block needs an elements class name. */ - function wp_render_elements_support($block_content, $block) + function wp_should_add_elements_class_name($block, $options) { } /** - * Renders the elements stylesheet. + * Render the elements stylesheet and adds elements class name to block as required. * * In the case of nested blocks we want the parent element styles to be rendered before their descendants. * This solves the issue of an element (e.g.: link color) being styled in both the parent and a descendant: @@ -94303,13 +95668,28 @@ function wp_render_elements_support($block_content, $block) * * @since 6.0.0 * @since 6.1.0 Implemented the style engine to generate CSS and classnames. + * @since 6.6.0 Element block support class and styles are generated via the `render_block_data` filter instead of `pre_render_block`. * @access private * - * @param string|null $pre_render The pre-rendered content. Default null. - * @param array $block The block being rendered. - * @return null + * @param array $parsed_block The parsed block. + * @return array The same parsed block with elements classname added if appropriate. */ - function wp_render_elements_support_styles($pre_render, $block) + function wp_render_elements_support_styles($parsed_block) + { + } + /** + * Ensure the elements block support class name generated, and added to + * block attributes, in the `render_block_data` filter gets applied to the + * block's markup. + * + * @see wp_render_elements_support_styles + * @since 6.6.0 + * + * @param string $block_content Rendered block content. + * @param array $block Block object. + * @return string Filtered block content. + */ + function wp_render_elements_class_name($block_content, $block) { } /** @@ -94358,6 +95738,7 @@ function wp_apply_generated_classname_support($block_type) * also be updated. * * @since 6.3.0 + * @since 6.6.0 Updated specificity for compatibility with 0-1-0 global styles specificity. * @access private * * @return array[] Layout definitions. @@ -94383,6 +95764,8 @@ function wp_register_layout_support($block_type) * @since 5.9.0 * @since 6.1.0 Added `$block_spacing` param, use style engine to enqueue styles. * @since 6.3.0 Added grid layout type. + * @since 6.6.0 Removed duplicated selector from layout styles. + * Enabled negative margins for alignfull children of blocks with custom padding. * @access private * * @param string $selector CSS selector. @@ -94404,6 +95787,7 @@ function wp_get_layout_style($selector, $layout, $has_block_gap_support = \false * @since 5.8.0 * @since 6.3.0 Adds compound class to layout wrapper for global spacing styles. * @since 6.3.0 Check for layout support via the `layout` key with fallback to `__experimentalLayout`. + * @since 6.6.0 Removed duplicate container class from layout styles. * @access private * * @param string $block_content Rendered block content. @@ -94413,6 +95797,21 @@ function wp_get_layout_style($selector, $layout, $has_block_gap_support = \false function wp_render_layout_support_flag($block_content, $block) { } + /** + * Check if the parent block exists and if it has a layout attribute. + * If it does, add the parent layout to the parsed block + * + * @since 6.6.0 + * @access private + * + * @param array $parsed_block The parsed block. + * @param array $source_block The source block. + * @param WP_Block $parent_block The parent block. + * @return array The parsed block with parent layout attribute if it exists. + */ + function wp_add_parent_layout_to_parsed_block($parsed_block, $source_block, $parent_block) + { + } /** * For themes without theme.json file, make sure * to restore the inner div for the group block @@ -94548,6 +95947,7 @@ function wp_register_shadow_support($block_type) * This will be applied to the block markup in the front-end. * * @since 6.3.0 + * @since 6.6.0 Return early if __experimentalSkipSerialization is true. * @access private * * @param WP_Block_Type $block_type Block type. @@ -94725,16 +96125,17 @@ function wp_get_computed_fluid_typography_value($args = array()) * @since 6.2.0 Added 'settings.typography.fluid.minFontSize' support. * @since 6.3.0 Using layout.wideSize as max viewport width, and logarithmic scale factor to calculate minimum font scale. * @since 6.4.0 Added configurable min and max viewport width values to the typography.fluid theme.json schema. + * @since 6.6.0 Deprecated bool argument $should_use_fluid_typography. * - * @param array $preset { + * @param array $preset { * Required. fontSizes preset value as seen in theme.json. * * @type string $name Name of the font size preset. * @type string $slug Kebab-case, unique identifier for the font size preset. * @type string|int|float $size CSS font-size value, including units if applicable. * } - * @param bool $should_use_fluid_typography An override to switch fluid typography "on". Can be used for unit testing. - * Default is false. + * @param bool|array $settings Optional Theme JSON settings array that overrides any global theme settings. + * Default is false. * @return string|null Font-size value or null if a size is not passed in $preset. * @phpstan-param array{ * name?: string, @@ -94742,7 +96143,7 @@ function wp_get_computed_fluid_typography_value($args = array()) * size?: string|int|float, * } $preset */ - function wp_get_typography_font_size_value($preset, $should_use_fluid_typography = \false) + function wp_get_typography_font_size_value($preset, $settings = array()) { } /** @@ -94796,7 +96197,26 @@ function get_block_theme_folders($theme_stylesheet = \null) * * @since 5.9.0 * - * @return array[] The supported template part area values. + * @return array[] { + * The allowed template part area values. + * + * @type array ...$0 { + * Data for the allowed template part area. + * + * @type string $area Template part area name. + * @type string $label Template part area label. + * @type string $description Template part area description. + * @type string $icon Template part area icon. + * @type string $area_tag Template part area tag. + * } + * } + * @phpstan-return array */ function get_allowed_block_template_part_areas() { @@ -94807,7 +96227,20 @@ function get_allowed_block_template_part_areas() * * @since 5.9.0 * - * @return array[] The default template types. + * @return array[] { + * The default template types. + * + * @type array ...$0 { + * Data for the template type. + * + * @type string $title Template type title. + * @type string $description Template type description. + * } + * } + * @phpstan-return array */ function get_default_block_template_types() { @@ -94846,18 +96279,27 @@ function _get_block_templates_paths($base_directory) * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. * @param string $slug Template slug. * @return array|null { - * Array with template metadata if $template_type is one of 'wp_template' or 'wp_template_part', - * null otherwise. - * - * @type string $slug Template slug. - * @type string $path Template file path. - * @type string $theme Theme slug. - * @type string $type Template type. - * @type string $area Template area. Only for 'wp_template_part'. - * @type string $title Optional. Template title. - * @type string[] $postTypes Optional. List of post types that the template supports. Only for 'wp_template'. + * Array with template metadata if $template_type is one of 'wp_template' or 'wp_template_part', + * null otherwise. + * + * @type string $slug Template slug. + * @type string $path Template file path. + * @type string $theme Theme slug. + * @type string $type Template type. + * @type string $area Template area. Only for 'wp_template_part'. + * @type string $title Optional. Template title. + * @type string[] $postTypes Optional. List of post types that the template supports. Only for 'wp_template'. * } * @phpstan-param 'wp_template'|'wp_template_part' $template_type + * @phpstan-return null|array{ + * slug: string, + * path: string, + * theme: string, + * type: string, + * area: string, + * title: string, + * postTypes: string[], + * } */ function _get_block_template_file($template_type, $slug) { @@ -95091,8 +96533,7 @@ function get_block_file_template($id, $template_type = 'wp_template') * * @since 5.9.0 * - * @param string $part The block template part to print. Either 'header' or 'footer'. - * @phpstan-param 'header'|'footer' $part + * @param string $part The block template part to print, for example 'header' or 'footer'. * @phpstan-return void */ function block_template_part($part) @@ -95245,8 +96686,8 @@ function _block_template_render_title_tag() * * @global string $_wp_current_template_id * @global string $_wp_current_template_content - * @global WP_Embed $wp_embed - * @global WP_Query $wp_query + * @global WP_Embed $wp_embed WordPress Embed object. + * @global WP_Query $wp_query WordPress Query object. * * @return string Block template markup. */ @@ -95593,11 +97034,11 @@ function get_hooked_blocks() * @since 6.5.0 * @access private * - * @param array $parsed_anchor_block The anchor block, in parsed block array format. - * @param string $relative_position The relative position of the hooked blocks. - * Can be one of 'before', 'after', 'first_child', or 'last_child'. - * @param array $hooked_blocks An array of hooked block types, grouped by anchor block and relative position. - * @param WP_Block_Template|array $context The block template, template part, or pattern that the anchor block belongs to. + * @param array $parsed_anchor_block The anchor block, in parsed block array format. + * @param string $relative_position The relative position of the hooked blocks. + * Can be one of 'before', 'after', 'first_child', or 'last_child'. + * @param array $hooked_blocks An array of hooked block types, grouped by anchor block and relative position. + * @param WP_Block_Template|WP_Post|array $context The block template, template part, or pattern that the anchor block belongs to. * @return string * @phpstan-param 'before'|'after'|'first_child'|'last_child' $relative_position */ @@ -95612,17 +97053,91 @@ function insert_hooked_blocks(&$parsed_anchor_block, $relative_position, $hooked * @since 6.5.0 * @access private * - * @param array $parsed_anchor_block The anchor block, in parsed block array format. - * @param string $relative_position The relative position of the hooked blocks. - * Can be one of 'before', 'after', 'first_child', or 'last_child'. - * @param array $hooked_blocks An array of hooked block types, grouped by anchor block and relative position. - * @param WP_Block_Template|array $context The block template, template part, or pattern that the anchor block belongs to. - * @return string An empty string. + * @param array $parsed_anchor_block The anchor block, in parsed block array format. + * @param string $relative_position The relative position of the hooked blocks. + * Can be one of 'before', 'after', 'first_child', or 'last_child'. + * @param array $hooked_blocks An array of hooked block types, grouped by anchor block and relative position. + * @param WP_Block_Template|WP_Post|array $context The block template, template part, or pattern that the anchor block belongs to. + * @return string Empty string. * @phpstan-param 'before'|'after'|'first_child'|'last_child' $relative_position */ function set_ignored_hooked_blocks_metadata(&$parsed_anchor_block, $relative_position, $hooked_blocks, $context) { } + /** + * Runs the hooked blocks algorithm on the given content. + * + * @since 6.6.0 + * @access private + * + * @param string $content Serialized content. + * @param WP_Block_Template|WP_Post|array $context A block template, template part, `wp_navigation` post object, + * or pattern that the blocks belong to. + * @param callable $callback A function that will be called for each block to generate + * the markup for a given list of blocks that are hooked to it. + * Default: 'insert_hooked_blocks'. + * @return string The serialized markup. + */ + function apply_block_hooks_to_content($content, $context, $callback = 'insert_hooked_blocks') + { + } + /** + * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks. + * + * @since 6.6.0 + * @access private + * + * @param string $serialized_block The serialized markup of a block and its inner blocks. + * @return string The serialized markup of the inner blocks. + */ + function remove_serialized_parent_block($serialized_block) + { + } + /** + * Updates the wp_postmeta with the list of ignored hooked blocks where the inner blocks are stored as post content. + * Currently only supports `wp_navigation` post types. + * + * @since 6.6.0 + * @access private + * + * @param stdClass $post Post object. + * @return stdClass The updated post object. + */ + function update_ignored_hooked_blocks_postmeta($post) + { + } + /** + * Returns the markup for blocks hooked to the given anchor block in a specific relative position and then + * adds a list of hooked block types to an anchor block's ignored hooked block types. + * + * This function is meant for internal use only. + * + * @since 6.6.0 + * @access private + * + * @param array $parsed_anchor_block The anchor block, in parsed block array format. + * @param string $relative_position The relative position of the hooked blocks. + * Can be one of 'before', 'after', 'first_child', or 'last_child'. + * @param array $hooked_blocks An array of hooked block types, grouped by anchor block and relative position. + * @param WP_Block_Template|WP_Post|array $context The block template, template part, or pattern that the anchor block belongs to. + * @return string + * @phpstan-param 'before'|'after'|'first_child'|'last_child' $relative_position + */ + function insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata(&$parsed_anchor_block, $relative_position, $hooked_blocks, $context) + { + } + /** + * Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks. + * + * @since 6.6.0 + * + * @param WP_REST_Response $response The response object. + * @param WP_Post $post Post object. + * @return WP_REST_Response The response object. + */ + function insert_hooked_blocks_into_rest_response($response, $post) + { + } /** * Returns a function that injects the theme attribute into, and hooked blocks before, a given block. * @@ -95731,8 +97246,25 @@ function get_comment_delimited_block_content($block_name, $block_attributes, $bl * * @since 5.3.1 * - * @param array $block A representative array of a single parsed block object. See WP_Block_Parser_Block. + * @param array $block { + * A representative array of a single parsed block object. See WP_Block_Parser_Block. + * + * @type string $blockName Name of block. + * @type array $attrs Attributes from block comment delimiters. + * @type array[] $innerBlocks List of inner blocks. An array of arrays that + * have the same structure as this one. + * @type string $innerHTML HTML from inside block comment delimiters. + * @type array $innerContent List of string fragments and null markers where + * inner blocks were found. + * } * @return string String of rendered HTML. + * @phpstan-param array{ + * blockName?: string, + * attrs?: array, + * innerBlocks?: array[], + * innerHTML?: string, + * innerContent?: array, + * } $block */ function serialize_block($block) { @@ -95743,8 +97275,29 @@ function serialize_block($block) * * @since 5.3.1 * - * @param array[] $blocks An array of representative arrays of parsed block objects. See serialize_block(). + * @param array[] $blocks { + * Array of block structures. + * + * @type array ...$0 { + * A representative array of a single parsed block object. See WP_Block_Parser_Block. + * + * @type string $blockName Name of block. + * @type array $attrs Attributes from block comment delimiters. + * @type array[] $innerBlocks List of inner blocks. An array of arrays that + * have the same structure as this one. + * @type string $innerHTML HTML from inside block comment delimiters. + * @type array $innerContent List of string fragments and null markers where + * inner blocks were found. + * } + * } * @return string String of rendered HTML. + * @phpstan-param array $blocks */ function serialize_blocks($blocks) { @@ -95786,6 +97339,18 @@ function serialize_blocks($blocks) function traverse_and_serialize_block($block, $pre_callback = \null, $post_callback = \null) { } + /** + * Replaces patterns in a block tree with their content. + * + * @since 6.6.0 + * + * @param array $blocks An array blocks. + * + * @return array An array of blocks with patterns replaced by their content. + */ + function resolve_pattern_blocks($blocks) + { + } /** * Given an array of parsed block trees, applies callbacks before and after serializing them and * returns their concatenated output. @@ -95894,11 +97459,11 @@ function filter_block_kses_value($value, $allowed_html, $allowed_protocols = arr * * @since 6.5.5 * - * @param string $attribute_value The attribute value to filter. - * @param string $attribute_name The attribute name. - * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, - * or a context name such as 'post'. See wp_kses_allowed_html() - * for the list of accepted context names. + * @param string $attribute_value The attribute value to filter. + * @param string $attribute_name The attribute name. + * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, + * or a context name such as 'post'. See wp_kses_allowed_html() + * for the list of accepted context names. * @return string The sanitized attribute value. */ function filter_block_core_template_part_attributes($attribute_value, $attribute_name, $allowed_html) @@ -95951,8 +97516,25 @@ function _excerpt_render_inner_blocks($parsed_block, $allowed_blocks) * * @global WP_Post $post The post to edit. * - * @param array $parsed_block A single parsed block object. + * @param array $parsed_block { + * A representative array of the block being rendered. See WP_Block_Parser_Block. + * + * @type string $blockName Name of block. + * @type array $attrs Attributes from block comment delimiters. + * @type array[] $innerBlocks List of inner blocks. An array of arrays that + * have the same structure as this one. + * @type string $innerHTML HTML from inside block comment delimiters. + * @type array $innerContent List of string fragments and null markers where + * inner blocks were found. + * } * @return string String of rendered HTML. + * @phpstan-param array{ + * blockName?: string, + * attrs?: array, + * innerBlocks?: array[], + * innerHTML?: string, + * innerContent?: array, + * } $parsed_block */ function render_block($parsed_block) { @@ -95963,7 +97545,28 @@ function render_block($parsed_block) * @since 5.0.0 * * @param string $content Post content. - * @return array[] Array of parsed block objects. + * @return array[] { + * Array of block structures. + * + * @type array ...$0 { + * A representative array of a single parsed block object. See WP_Block_Parser_Block. + * + * @type string $blockName Name of block. + * @type array $attrs Attributes from block comment delimiters. + * @type array[] $innerBlocks List of inner blocks. An array of arrays that + * have the same structure as this one. + * @type string $innerHTML HTML from inside block comment delimiters. + * @type array $innerContent List of string fragments and null markers where + * inner blocks were found. + * } + * } + * @phpstan-return array */ function parse_blocks($content) { @@ -96009,14 +97612,16 @@ function block_version($content) * Registers a new block style. * * @since 5.3.0 + * @since 6.6.0 Added support for registering styles for multiple block types. * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/ * - * @param string $block_name Block type name including namespace. - * @param array $style_properties Array containing the properties of the style name, label, - * style_handle (name of the stylesheet to be enqueued), - * inline_style (string containing the CSS to be added). - * See WP_Block_Styles_Registry::register(). + * @param string|string[] $block_name Block type name including namespace or array of namespaced block type names. + * @param array $style_properties Array containing the properties of the style name, label, + * style_handle (name of the stylesheet to be enqueued), + * inline_style (string containing the CSS to be added), + * style_data (theme.json-like array to generate CSS from). + * See WP_Block_Styles_Registry::register(). * @return bool True if the block style was registered with success and false otherwise. * @phpstan-param array{ * name?: string, @@ -96024,6 +97629,7 @@ function block_version($content) * inline_style?: string, * style_handle?: string, * is_default?: bool, + * style_data?: array, * } $style_properties See WP_Block_Styles_Registry::register() */ function register_block_style($block_name, $style_properties) @@ -96200,6 +97806,8 @@ function _wp_footnotes_force_filtered_html_on_import_filter($arg) /** * Renders the `core/archives` block on server. * + * @since 5.0.0 + * * @see WP_Widget_Archives * * @param array $attributes The block attributes. @@ -96211,6 +97819,8 @@ function render_block_core_archives($attributes) } /** * Register archives block. + * + * @since 5.0.0 */ function register_block_core_archives() { @@ -96223,6 +97833,8 @@ function register_block_core_archives() /** * Renders the `core/avatar` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96235,6 +97847,8 @@ function render_block_core_avatar($attributes, $content, $block) * Generates class names and styles to apply the border support styles for * the Avatar block. * + * @since 6.3.0 + * * @param array $attributes The block attributes. * @return array The border-related classnames and styles for the block. */ @@ -96243,6 +97857,8 @@ function get_block_core_avatar_border_attributes($attributes) } /** * Registers the `core/avatar` block on the server. + * + * @since 6.0.0 */ function register_block_core_avatar() { @@ -96255,6 +97871,10 @@ function register_block_core_avatar() /** * Renders the `core/block` block on server. * + * @since 5.0.0 + * + * @global WP_Embed $wp_embed + * * @param array $attributes The block attributes. * * @return string Rendered HTML of the referenced block. @@ -96264,10 +97884,39 @@ function render_block_core_block($attributes) } /** * Registers the `core/block` block. + * + * @since 5.3.0 */ function register_block_core_block() { } + /** + * Server-side rendering of the `core/button` block. + * + * @package WordPress + */ + /** + * Renders the `core/button` block on the server, + * + * @since 6.6.0 + * + * @param array $attributes The block attributes. + * @param string $content The block content. + * @param WP_Block $block The block object. + * + * @return string The block content. + */ + function render_block_core_button($attributes, $content) + { + } + /** + * Registers the `core/button` block on server. + * + * @since 6.6.0 + */ + function register_block_core_button() + { + } /** * Server-side rendering of the `core/calendar` block. * @@ -96276,6 +97925,11 @@ function register_block_core_block() /** * Renders the `core/calendar` block on server. * + * @since 5.2.0 + * + * @global int $monthnum. + * @global int $year. + * * @param array $attributes The block attributes. * * @return string Returns the block content. @@ -96285,6 +97939,8 @@ function render_block_core_calendar($attributes) } /** * Registers the `core/calendar` block on server. + * + * @since 5.2.0 */ function register_block_core_calendar() { @@ -96295,6 +97951,8 @@ function register_block_core_calendar() * Used to hide the calendar block when there are no published posts. * This compensates for a known Core bug: https://core.trac.wordpress.org/ticket/12016 * + * @since 5.9.0 + * * @return bool Has any published posts or not. */ function block_core_calendar_has_published_posts() @@ -96304,6 +97962,10 @@ function block_core_calendar_has_published_posts() * Queries the database for any published post and saves * a flag whether any published post exists or not. * + * @since 5.9.0 + * + * @global wpdb $wpdb WordPress database abstraction object. + * * @return bool Has any published posts or not. */ function block_core_calendar_update_has_published_posts() @@ -96312,6 +97974,8 @@ function block_core_calendar_update_has_published_posts() /** * Handler for updating the has published posts flag when a post is deleted. * + * @since 5.9.0 + * * @param int $post_id Deleted post ID. * @phpstan-return void */ @@ -96321,6 +97985,8 @@ function block_core_calendar_update_has_published_post_on_delete($post_id) /** * Handler for updating the has published posts flag when a post status changes. * + * @since 5.9.0 + * * @param string $new_status The status the post is changing to. * @param string $old_status The status the post is changing from. * @param WP_Post $post Post object. @@ -96337,6 +98003,8 @@ function block_core_calendar_update_has_published_post_on_transition_post_status /** * Renders the `core/categories` block on server. * + * @since 5.0.0 + * * @param array $attributes The block attributes. * * @return string Returns the categories list/dropdown markup. @@ -96347,6 +98015,8 @@ function render_block_core_categories($attributes) /** * Generates the inline script for a categories dropdown field. * + * @since 5.0.0 + * * @param string $dropdown_id ID of the dropdown field. * * @return string Returns the dropdown onChange redirection script. @@ -96356,6 +98026,8 @@ function build_dropdown_script_block_core_categories($dropdown_id) } /** * Registers the `core/categories` block on server. + * + * @since 5.0.0 */ function register_block_core_categories() { @@ -96368,6 +98040,8 @@ function register_block_core_categories() /** * Renders the `core/comment-author-name` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96378,6 +98052,8 @@ function render_block_core_comment_author_name($attributes, $content, $block) } /** * Registers the `core/comment-author-name` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_author_name() { @@ -96390,6 +98066,8 @@ function register_block_core_comment_author_name() /** * Renders the `core/comment-content` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96400,6 +98078,8 @@ function render_block_core_comment_content($attributes, $content, $block) } /** * Registers the `core/comment-content` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_content() { @@ -96412,6 +98092,8 @@ function register_block_core_comment_content() /** * Renders the `core/comment-date` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96422,6 +98104,8 @@ function render_block_core_comment_date($attributes, $content, $block) } /** * Registers the `core/comment-date` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_date() { @@ -96434,6 +98118,8 @@ function register_block_core_comment_date() /** * Renders the `core/comment-edit-link` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96445,6 +98131,8 @@ function render_block_core_comment_edit_link($attributes, $content, $block) } /** * Registers the `core/comment-edit-link` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_edit_link() { @@ -96457,6 +98145,8 @@ function register_block_core_comment_edit_link() /** * Renders the `core/comment-reply-link` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96467,6 +98157,8 @@ function render_block_core_comment_reply_link($attributes, $content, $block) } /** * Registers the `core/comment-reply-link` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_reply_link() { @@ -96493,6 +98185,8 @@ function block_core_comment_template_render_comments($comments, $block) /** * Renders the `core/comment-template` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96505,6 +98199,8 @@ function render_block_core_comment_template($attributes, $content, $block) } /** * Registers the `core/comment-template` block on the server. + * + * @since 6.0.0 */ function register_block_core_comment_template() { @@ -96517,6 +98213,8 @@ function register_block_core_comment_template() /** * Renders the `core/comments-pagination-next` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96528,6 +98226,8 @@ function render_block_core_comments_pagination_next($attributes, $content, $bloc } /** * Registers the `core/comments-pagination-next` block on the server. + * + * @since 6.0.0 */ function register_block_core_comments_pagination_next() { @@ -96540,6 +98240,8 @@ function register_block_core_comments_pagination_next() /** * Renders the `core/comments-pagination-numbers` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96551,6 +98253,8 @@ function render_block_core_comments_pagination_numbers($attributes, $content, $b } /** * Registers the `core/comments-pagination-numbers` block on the server. + * + * @since 6.0.0 */ function register_block_core_comments_pagination_numbers() { @@ -96563,6 +98267,8 @@ function register_block_core_comments_pagination_numbers() /** * Renders the `core/comments-pagination-previous` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96574,6 +98280,8 @@ function render_block_core_comments_pagination_previous($attributes, $content, $ } /** * Registers the `core/comments-pagination-previous` block on the server. + * + * @since 6.0.0 */ function register_block_core_comments_pagination_previous() { @@ -96586,6 +98294,8 @@ function register_block_core_comments_pagination_previous() /** * Renders the `core/comments-pagination` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @@ -96596,6 +98306,8 @@ function render_block_core_comments_pagination($attributes, $content) } /** * Registers the `core/comments-pagination` block on the server. + * + * @since 6.0.0 */ function register_block_core_comments_pagination() { @@ -96608,6 +98320,8 @@ function register_block_core_comments_pagination() /** * Renders the `core/comments-title` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * * @return string Return the post comments title. @@ -96617,6 +98331,8 @@ function render_block_core_comments_title($attributes) } /** * Registers the `core/comments-title` block on the server. + * + * @since 6.0.0 */ function register_block_core_comments_title() { @@ -96637,6 +98353,10 @@ function register_block_core_comments_title() * the block is in legacy mode. If not, the HTML generated in the editor is * returned instead. * + * @since 6.1.0 + * + * @global WP_Post $post Global post object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -96647,6 +98367,8 @@ function render_block_core_comments($attributes, $content, $block) } /** * Registers the `core/comments` block on the server. + * + * @since 6.1.0 */ function register_block_core_comments() { @@ -96654,6 +98376,8 @@ function register_block_core_comments() /** * Use the button block classes for the form-submit button. * + * @since 6.1.0 + * * @param array $fields The default comment form arguments. * * @return array Returns the modified fields. @@ -96665,6 +98389,8 @@ function comments_block_form_defaults($fields) * Enqueues styles from the legacy `core/post-comments` block. These styles are * required only by the block's fallback. * + * @since 6.1.0 + * * @param string $block_name Name of the new block type. */ function enqueue_legacy_post_comments_block_styles($block_name) @@ -96677,6 +98403,8 @@ function enqueue_legacy_post_comments_block_styles($block_name) * The same approach was followed when core/query-loop was renamed to * core/post-template. * + * @since 6.1.0 + * * @see https://github.com/WordPress/gutenberg/pull/41807 * @see https://github.com/WordPress/gutenberg/pull/32514 */ @@ -96691,6 +98419,8 @@ function register_legacy_post_comments_block() /** * Renders the `core/cover` block on server. * + * @since 6.0.0 + * * @param array $attributes The block attributes. * @param string $content The block rendered content. * @@ -96701,6 +98431,8 @@ function render_block_core_cover($attributes, $content) } /** * Registers the `core/cover` block renderer on server. + * + * @since 6.0.0 */ function register_block_core_cover() { @@ -96713,6 +98445,8 @@ function register_block_core_cover() /** * When the `core/file` block is rendering, check if we need to enqueue the `wp-block-file-view` script. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * @param string $content The block content. * @param WP_Block $block The parsed block. @@ -96724,6 +98458,8 @@ function render_block_core_file($attributes, $content) } /** * Registers the `core/file` block on server. + * + * @since 5.8.0 */ function register_block_core_file() { @@ -96801,6 +98537,8 @@ function wp_get_footnotes_from_revision($revision_field, $field, $revision) * we add a custom `data-id` attribute before rendering the gallery * so that the Image Block can pick it up in its render_callback. * + * @since 5.9.0 + * * @param array $parsed_block The block being rendered. * @return array The migrated block object. */ @@ -96810,6 +98548,8 @@ function block_core_gallery_data_id_backcompatibility($parsed_block) /** * Renders the `core/gallery` block on the server. * + * @since 6.0.0 + * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. * @return string The content of the block being rendered. @@ -96819,6 +98559,8 @@ function block_core_gallery_render($attributes, $content) } /** * Registers the `core/gallery` block on server. + * + * @since 5.9.0 */ function register_block_core_gallery() { @@ -96837,6 +98579,8 @@ function register_block_core_gallery() * Would be transformed to: *

Hello World

* + * @since 6.2.0 + * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. * @@ -96847,6 +98591,8 @@ function block_core_heading_render($attributes, $content) } /** * Registers the `core/heading` block on server. + * + * @since 6.2.0 */ function register_block_core_heading() { @@ -96860,6 +98606,8 @@ function register_block_core_heading() * Build an array with CSS classes and inline styles defining the colors * which will be applied to the home link markup in the front-end. * + * @since 6.0.0 + * * @param array $context home link block context. * @return array Colors CSS classes and inline styles. */ @@ -96870,6 +98618,8 @@ function block_core_home_link_build_css_colors($context) * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the home link markup in the front-end. * + * @since 6.0.0 + * * @param array $context Home link block context. * @return array Font size CSS classes and inline styles. */ @@ -96879,6 +98629,8 @@ function block_core_home_link_build_css_font_sizes($context) /** * Builds an array with classes and style for the li wrapper * + * @since 6.0.0 + * * @param array $context Home link block context. * @return string The li wrapper attributes. */ @@ -96888,6 +98640,8 @@ function block_core_home_link_build_li_wrapper_attributes($context) /** * Renders the `core/home-link` block. * + * @since 6.0.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -96900,6 +98654,8 @@ function render_block_core_home_link($attributes, $content, $block) /** * Register the home block * + * @since 6.0.0 + * * @uses render_block_core_home_link() * @throws WP_Error An WP_Error exception parsing the block definition. */ @@ -96915,6 +98671,8 @@ function register_block_core_home_link() * Renders the `core/image` block on the server, * adding a data-id attribute to the element if core/gallery has added on pre-render. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * @param string $content The block content. * @param WP_Block $block The block object. @@ -96929,6 +98687,8 @@ function render_block_core_image($attributes, $content, $block) * * This is used to determine whether the lightbox should be rendered or not. * + * @since 6.4.0 + * * @param array $block Block data. * * @return array Filtered block data. @@ -96939,6 +98699,8 @@ function block_core_image_get_lightbox_settings($block) /** * Adds the directives and layout needed for the lightbox behavior. * + * @since 6.4.0 + * * @param string $block_content Rendered block content. * @param array $block Block object. * @@ -96947,11 +98709,16 @@ function block_core_image_get_lightbox_settings($block) function block_core_image_render_lightbox($block_content, $block) { } + /** + * @since 6.5.0 + */ function block_core_image_print_lightbox_overlay() { } /** * Registers the `core/image` block on server. + * + * @since 5.9.0 */ function register_block_core_image() { @@ -97010,6 +98777,8 @@ function wp_latest_comments_draft_or_post_title($post = 0) /** * Renders the `core/latest-comments` block on server. * + * @since 5.1.0 + * * @param array $attributes The block attributes. * * @return string Returns the post content with latest comments added. @@ -97019,6 +98788,8 @@ function render_block_core_latest_comments($attributes = array()) } /** * Registers the `core/latest-comments` block. + * + * @since 5.3.0 */ function register_block_core_latest_comments() { @@ -97027,6 +98798,8 @@ function register_block_core_latest_comments() * Callback for the excerpt_length filter used by * the Latest Posts block at render time. * + * @since 5.4.0 + * * @return int Returns the global $block_core_latest_posts_excerpt_length variable * to allow the excerpt_length filter respect the Latest Block setting. */ @@ -97036,6 +98809,8 @@ function block_core_latest_posts_get_excerpt_length() /** * Renders the `core/latest-posts` block on server. * + * @since 5.0.0 + * * @param array $attributes The block attributes. * * @return string Returns the post content with latest posts added. @@ -97045,6 +98820,8 @@ function render_block_core_latest_posts($attributes) } /** * Registers the `core/latest-posts` block on server. + * + * @since 5.0.0 */ function register_block_core_latest_posts() { @@ -97061,6 +98838,8 @@ function register_block_core_latest_posts() * TODO: Remove when and if the bottom client-side deprecation for this block * is removed. * + * @since 5.5.0 + * * @param array $block A single parsed block object. * * @return array The migrated block object. @@ -97076,6 +98855,10 @@ function block_core_latest_posts_migrate_categories($block) /** * Renders the 'core/legacy-widget' block. * + * @since 5.8.0 + * + * @global int $wp_widget_factory. + * * @param array $attributes The block attributes. * * @return string Rendered block. @@ -97085,6 +98868,8 @@ function render_block_core_legacy_widget($attributes) } /** * Registers the 'core/legacy-widget' block. + * + * @since 5.8.0 */ function register_block_core_legacy_widget() { @@ -97093,11 +98878,43 @@ function register_block_core_legacy_widget() * Intercepts any request with legacy-widget-preview in the query param and, if * set, renders a page containing a preview of the requested Legacy Widget * block. + * + * @since 5.8.0 * @phpstan-return void */ function handle_legacy_widget_preview_iframe() { } + /** + * Adds the wp-block-list class to the rendered list block. + * + * @package WordPress + */ + /** + * Adds the wp-block-list class to the rendered list block. + * Ensures that pre-existing list blocks use the class name on the front. + * For example,
    is transformed to
      . + * + * @since 6.6.0 + * + * @see https://github.com/WordPress/gutenberg/issues/12420 + * + * @param array $attributes Attributes of the block being rendered. + * @param string $content Content of the block being rendered. + * + * @return string The content of the block being rendered. + */ + function block_core_list_render($attributes, $content) + { + } + /** + * Registers the `core/list` block on server. + * + * @since 6.6.0 + */ + function register_block_core_list() + { + } /** * Server-side rendering of the `core/loginout` block. * @@ -97106,6 +98923,8 @@ function handle_legacy_widget_preview_iframe() /** * Renders the `core/loginout` block on server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return string Returns the login-out link or form. @@ -97115,10 +98934,38 @@ function render_block_core_loginout($attributes) } /** * Registers the `core/loginout` block on server. + * + * @since 5.8.0 */ function register_block_core_loginout() { } + /** + * Server-side rendering of the `core/media-text` block. + * + * @package WordPress + */ + /** + * Renders the `core/media-text` block on server. + * + * @since 6.6.0 + * + * @param array $attributes The block attributes. + * @param string $content The block rendered content. + * + * @return string Returns the Media & Text block markup, if useFeaturedImage is true. + */ + function render_block_core_media_text($attributes, $content) + { + } + /** + * Registers the `core/media-text` block renderer on server. + * + * @since 6.6.0 + */ + function register_block_core_media_text() + { + } /** * Server-side registering and rendering of the `core/navigation-link` block. * @@ -97128,6 +98975,8 @@ function register_block_core_loginout() * Build an array with CSS classes and inline styles defining the colors * which will be applied to the navigation markup in the front-end. * + * @since 5.9.0 + * * @param array $context Navigation block context. * @param array $attributes Block attributes. * @param bool $is_sub_menu Whether the link is part of a sub-menu. @@ -97140,6 +98989,8 @@ function block_core_navigation_link_build_css_colors($context, $attributes, $is_ * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * + * @since 5.9.0 + * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ @@ -97149,6 +99000,8 @@ function block_core_navigation_link_build_css_font_sizes($context) /** * Returns the top-level submenu SVG chevron icon. * + * @since 5.9.0 + * * @return string */ function block_core_navigation_link_render_submenu_icon() @@ -97157,6 +99010,8 @@ function block_core_navigation_link_render_submenu_icon() /** * Decodes a url if it's encoded, returning the same url if not. * + * @since 6.2.0 + * * @param string $url The url to decode. * * @return string $url Returns the decoded url. @@ -97167,6 +99022,8 @@ function block_core_navigation_link_maybe_urldecode($url) /** * Renders the `core/navigation-link` block. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -97179,6 +99036,8 @@ function render_block_core_navigation_link($attributes, $content, $block) /** * Returns a navigation link variation * + * @since 5.9.0 + * * @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity. * @param string $kind string of value 'taxonomy' or 'post-type'. * @@ -97212,6 +99071,8 @@ function block_core_navigation_link_build_variations() /** * Registers the navigation link block. * + * @since 5.9.0 + * * @uses render_block_core_navigation_link() * @throws WP_Error An WP_Error exception parsing the block definition. */ @@ -97227,6 +99088,8 @@ function register_block_core_navigation_link() * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * + * @since 5.9.0 + * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ @@ -97236,6 +99099,8 @@ function block_core_navigation_submenu_build_css_font_sizes($context) /** * Returns the top-level submenu SVG chevron icon. * + * @since 5.9.0 + * * @return string */ function block_core_navigation_submenu_render_submenu_icon() @@ -97244,6 +99109,8 @@ function block_core_navigation_submenu_render_submenu_icon() /** * Renders the `core/navigation-submenu` block. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -97256,6 +99123,8 @@ function render_block_core_navigation_submenu($attributes, $content, $block) /** * Register the navigation submenu block. * + * @since 5.9.0 + * * @uses render_block_core_navigation_submenu() * @throws WP_Error An WP_Error exception parsing the block definition. */ @@ -97265,6 +99134,8 @@ function register_block_core_navigation_submenu() /** * Returns the menu items for a WordPress menu location. * + * @since 5.9.0 + * * @param string $location The menu location. * @return array Menu items for the location. */ @@ -97275,6 +99146,8 @@ function block_core_navigation_get_menu_items_at_location($location) * Sorts a standard array of menu items into a nested structure keyed by the * id of the parent menu. * + * @since 5.9.0 + * * @param array $menu_items Menu items to sort. * @return array An array keyed by the id of the parent menu where each element * is an array of menu items that belong to that parent. @@ -97285,6 +99158,8 @@ function block_core_navigation_sort_menu_items_by_parent_id($menu_items) /** * Gets the inner blocks for the navigation block from the unstable location attribute. * + * @since 6.5.0 + * * @param array $attributes The block attributes. * @return WP_Block_List Returns the inner blocks for the navigation block. */ @@ -97295,6 +99170,8 @@ function block_core_navigation_get_inner_blocks_from_unstable_location($attribut * Add Interactivity API directives to the navigation-submenu and page-list * blocks markup using the Tag Processor. * + * @since 6.3.0 + * * @param WP_HTML_Tag_Processor $tags Markup of the navigation block. * @param array $block_attributes Block attributes. * @@ -97307,6 +99184,8 @@ function block_core_navigation_add_directives_to_submenu($tags, $block_attribute * Build an array with CSS classes and inline styles defining the colors * which will be applied to the navigation markup in the front-end. * + * @since 5.9.0 + * * @param array $attributes Navigation block attributes. * * @return array Colors CSS classes and inline styles. @@ -97318,6 +99197,8 @@ function block_core_navigation_build_css_colors($attributes) * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * + * @since 5.9.0 + * * @param array $attributes Navigation block attributes. * * @return array Font size CSS classes and inline styles. @@ -97328,6 +99209,8 @@ function block_core_navigation_build_css_font_sizes($attributes) /** * Returns the top-level submenu SVG chevron icon. * + * @since 5.9.0 + * * @return string */ function block_core_navigation_render_submenu_icon() @@ -97339,6 +99222,8 @@ function block_core_navigation_render_submenu_icon() * it encounters whitespace. This is not a bug but rather how the parser * is designed. * + * @since 5.9.0 + * * @param array $parsed_blocks the parsed blocks to be normalized. * @return array the normalized parsed blocks. */ @@ -97348,6 +99233,8 @@ function block_core_navigation_filter_out_empty_blocks($parsed_blocks) /** * Returns true if the navigation block contains a nested navigation block. * + * @since 6.2.0 + * * @param WP_Block_List $inner_blocks Inner block instance to be normalized. * @return bool true if the navigation block contains a nested navigation block. */ @@ -97361,6 +99248,8 @@ function block_core_navigation_block_contains_core_navigation($inner_blocks) * This aims to mirror how the fallback mechanic for wp_nav_menu works. * See https://developer.wordpress.org/reference/functions/wp_nav_menu/#more-information. * + * @since 5.9.0 + * * @return array the array of blocks to be used as a fallback. */ function block_core_navigation_get_fallback_blocks() @@ -97369,6 +99258,8 @@ function block_core_navigation_get_fallback_blocks() /** * Iterate through all inner blocks recursively and get navigation link block's post IDs. * + * @since 6.0.0 + * * @param WP_Block_List $inner_blocks Block list class instance. * * @return array Array of post IDs. @@ -97379,6 +99270,8 @@ function block_core_navigation_get_post_ids($inner_blocks) /** * Get post IDs from a navigation link block instance. * + * @since 6.0.0 + * * @param WP_Block $block Instance of a block. * * @return array Array of post IDs. @@ -97389,6 +99282,8 @@ function block_core_navigation_from_block_get_post_ids($block) /** * Renders the `core/navigation` block on server. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -97401,6 +99296,8 @@ function render_block_core_navigation($attributes, $content, $block) /** * Register the navigation block. * + * @since 5.9.0 + * * @uses render_block_core_navigation() * @throws WP_Error An WP_Error exception parsing the block definition. */ @@ -97410,6 +99307,8 @@ function register_block_core_navigation() /** * Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly. * + * @since 5.9.0 + * * @param array $parsed_block The block being rendered. * * @return array The block being rendered without typographic presets. @@ -97420,6 +99319,8 @@ function block_core_navigation_typographic_presets_backcompatibility($parsed_blo /** * Turns menu item data into a nested array of parsed blocks * + * @since 5.9.0 + * * @deprecated 6.3.0 Use WP_Navigation_Fallback::parse_blocks_from_menu_items() instead. * * @param array $menu_items An array of menu items that represent @@ -97436,6 +99337,8 @@ function block_core_navigation_parse_blocks_from_menu_items($menu_items, $menu_i /** * Get the classic navigation menu to use as a fallback. * + * @since 6.2.0 + * * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead. * * @return object WP_Term The classic navigation. @@ -97446,6 +99349,8 @@ function block_core_navigation_get_classic_menu_fallback() /** * Converts a classic navigation to blocks. * + * @since 6.2.0 + * * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback_blocks() instead. * * @param object $classic_nav_menu WP_Term The classic navigation object to convert. @@ -97457,6 +99362,8 @@ function block_core_navigation_get_classic_menu_fallback_blocks($classic_nav_men /** * If there's a classic menu then use it as a fallback. * + * @since 6.2.0 + * * @deprecated 6.3.0 Use WP_Navigation_Fallback::create_classic_menu_fallback() instead. * * @return array the normalized parsed blocks. @@ -97467,6 +99374,8 @@ function block_core_navigation_maybe_use_classic_menu_fallback() /** * Finds the most recently published `wp_navigation` Post. * + * @since 6.1.0 + * * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_most_recently_published_navigation() instead. * * @return WP_Post|null the first non-empty Navigation or null. @@ -97477,6 +99386,8 @@ function block_core_navigation_get_most_recently_published_navigation() /** * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks. * + * @since 6.5.0 + * * @param string $serialized_block The serialized markup of a block and its inner blocks. * @return string */ @@ -97487,6 +99398,8 @@ function block_core_navigation_remove_serialized_parent_block($serialized_block) * Mock a parsed block for the Navigation block given its inner blocks and the `wp_navigation` post object. * The `wp_navigation` post's `_wp_ignored_hooked_blocks` meta is queried to add the `metadata.ignoredHookedBlocks` attribute. * + * @since 6.5.0 + * * @param array $inner_blocks Parsed inner blocks of a Navigation block. * @param WP_Post $post `wp_navigation` post object corresponding to the block. * @@ -97506,6 +99419,8 @@ function block_core_navigation_mock_parsed_block($inner_blocks, $post) * children, the `wp_navigation` post's `_wp_ignored_hooked_blocks` meta is checked to see if any * of those hooked blocks should be exempted from insertion. * + * @since 6.5.0 + * * @param array $inner_blocks Parsed inner blocks of a Navigation block. * @param WP_Post $post `wp_navigation` post object corresponding to the block. * @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any. @@ -97520,6 +99435,8 @@ function block_core_navigation_insert_hooked_blocks($inner_blocks, $post) * this function inserts ignoredHookedBlocks meta into it, and returns the serialized inner blocks in a * mock Navigation block wrapper. * + * @since 6.5.0 + * * @param array $inner_blocks Parsed inner blocks of a Navigation block. * @param WP_Post $post `wp_navigation` post object corresponding to the block. * @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any. @@ -97542,6 +99459,8 @@ function block_core_navigation_update_ignore_hooked_blocks_meta($post) /** * Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks. * + * @since 6.5.0 + * * @param WP_REST_Response $response The response object. * @param WP_Post $post Post object. * @return WP_REST_Response The response object. @@ -97556,6 +99475,8 @@ function block_core_navigation_insert_hooked_blocks_into_rest_response($response */ /** * Registers the `core/page-list-item` block on server. + * + * @since 6.3.0 */ function register_block_core_page_list_item() { @@ -97569,6 +99490,8 @@ function register_block_core_page_list_item() * Build an array with CSS classes and inline styles defining the colors * which will be applied to the pages markup in the front-end when it is a descendant of navigation. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param array $context Navigation block context. * @return array Colors CSS classes and inline styles. @@ -97580,6 +99503,8 @@ function block_core_page_list_build_css_colors($attributes, $context) * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the pages markup in the front-end when it is a descendant of navigation. * + * @since 5.8.0 + * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ @@ -97589,6 +99514,8 @@ function block_core_page_list_build_css_font_sizes($context) /** * Outputs Page list markup from an array of pages with nested children. * + * @since 5.8.0 + * * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover. * @param boolean $show_submenu_icons Whether to show submenu indicator icons. * @param boolean $is_navigation_child If block is a child of Navigation block. @@ -97606,6 +99533,8 @@ function block_core_page_list_render_nested_page_list($open_submenus_on_click, $ /** * Outputs nested array of pages * + * @since 5.8.0 + * * @param array $current_level The level being iterated through. * @param array $children The children grouped by parent post ID. * @@ -97617,6 +99546,8 @@ function block_core_page_list_nest_pages($current_level, $children) /** * Renders the `core/page-list` block on server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. @@ -97628,6 +99559,8 @@ function render_block_core_page_list($attributes, $content, $block) } /** * Registers the `core/pages` block on server. + * + * @since 5.8.0 */ function register_block_core_page_list() { @@ -97639,6 +99572,8 @@ function register_block_core_page_list() */ /** * Registers the `core/pattern` block on the server. + * + * @since 5.9.0 */ function register_block_core_pattern() { @@ -97665,6 +99600,8 @@ function render_block_core_pattern($attributes) /** * Renders the `core/post-author-biography` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97675,6 +99612,8 @@ function render_block_core_post_author_biography($attributes, $content, $block) } /** * Registers the `core/post-author-biography` block on the server. + * + * @since 6.0.0 */ function register_block_core_post_author_biography() { @@ -97687,6 +99626,8 @@ function register_block_core_post_author_biography() /** * Renders the `core/post-author-name` block on the server. * + * @since 6.2.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97697,6 +99638,8 @@ function render_block_core_post_author_name($attributes, $content, $block) } /** * Registers the `core/post-author-name` block on the server. + * + * @since 6.2.0 */ function register_block_core_post_author_name() { @@ -97709,6 +99652,8 @@ function register_block_core_post_author_name() /** * Renders the `core/post-author` block on the server. * + * @since 5.9.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97719,6 +99664,8 @@ function render_block_core_post_author($attributes, $content, $block) } /** * Registers the `core/post-author` block on the server. + * + * @since 5.9.0 */ function register_block_core_post_author() { @@ -97731,6 +99678,8 @@ function register_block_core_post_author() /** * Renders the `core/post-comments-form` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97741,6 +99690,8 @@ function render_block_core_post_comments_form($attributes, $content, $block) } /** * Registers the `core/post-comments-form` block on the server. + * + * @since 6.0.0 */ function register_block_core_post_comments_form() { @@ -97748,6 +99699,8 @@ function register_block_core_post_comments_form() /** * Use the button block classes for the form-submit button. * + * @since 6.0.0 + * * @param array $fields The default comment form arguments. * * @return array Returns the modified fields. @@ -97763,6 +99716,8 @@ function post_comments_form_block_form_defaults($fields) /** * Renders the `core/post-content` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97773,6 +99728,8 @@ function render_block_core_post_content($attributes, $content, $block) } /** * Registers the `core/post-content` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_content() { @@ -97785,6 +99742,8 @@ function register_block_core_post_content() /** * Renders the `core/post-date` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97795,6 +99754,8 @@ function render_block_core_post_date($attributes, $content, $block) } /** * Registers the `core/post-date` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_date() { @@ -97807,6 +99768,8 @@ function register_block_core_post_date() /** * Renders the `core/post-excerpt` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97817,6 +99780,8 @@ function render_block_core_post_excerpt($attributes, $content, $block) } /** * Registers the `core/post-excerpt` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_excerpt() { @@ -97829,6 +99794,8 @@ function register_block_core_post_excerpt() /** * Renders the `core/post-featured-image` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97840,6 +99807,8 @@ function render_block_core_post_featured_image($attributes, $content, $block) /** * Generate markup for the HTML element that will be used for the overlay. * + * @since 6.1.0 + * * @param array $attributes Block attributes. * * @return string HTML markup in string format. @@ -97851,6 +99820,8 @@ function get_block_core_post_featured_image_overlay_element_markup($attributes) * Generates class names and styles to apply the border support styles for * the Post Featured Image block. * + * @since 6.1.0 + * * @param array $attributes The block attributes. * @return array The border-related classnames and styles for the block. */ @@ -97859,6 +99830,8 @@ function get_block_core_post_featured_image_border_attributes($attributes) } /** * Registers the `core/post-featured-image` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_featured_image() { @@ -97871,6 +99844,8 @@ function register_block_core_post_featured_image() /** * Renders the `core/post-navigation-link` block on the server. * + * @since 5.9.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @@ -97881,6 +99856,8 @@ function render_block_core_post_navigation_link($attributes, $content) } /** * Registers the `core/post-navigation-link` block on the server. + * + * @since 5.9.0 */ function register_block_core_post_navigation_link() { @@ -97893,6 +99870,8 @@ function register_block_core_post_navigation_link() /** * Determines whether a block list contains a block that uses the featured image. * + * @since 6.0.0 + * * @param WP_Block_List $inner_blocks Inner block instance. * * @return bool Whether the block list contains a block that uses the featured image. @@ -97905,6 +99884,8 @@ function block_core_post_template_uses_featured_image($inner_blocks) * * @since 6.3.0 Changed render_block_context priority to `1`. * + * @global WP_Query $wp_query WordPress Query object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97916,6 +99897,8 @@ function render_block_core_post_template($attributes, $content, $block) } /** * Registers the `core/post-template` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_template() { @@ -97928,6 +99911,8 @@ function register_block_core_post_template() /** * Renders the `core/post-terms` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97939,6 +99924,8 @@ function render_block_core_post_terms($attributes, $content, $block) /** * Returns the available variations for the `core/post-terms` block. * + * @since 6.5.0 + * * @return array The available variations for the block. */ function block_core_post_terms_build_variations() @@ -97946,6 +99933,8 @@ function block_core_post_terms_build_variations() } /** * Registers the `core/post-terms` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_terms() { @@ -97971,6 +99960,8 @@ function render_block_core_post_title($attributes, $content, $block) } /** * Registers the `core/post-title` block on the server. + * + * @since 5.8.0 */ function register_block_core_post_title() { @@ -97983,6 +99974,10 @@ function register_block_core_post_title() /** * Renders the `core/query-no-results` block on the server. * + * @since 6.0.0 + * + * @global WP_Query $wp_query WordPress Query object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -97994,6 +99989,8 @@ function render_block_core_query_no_results($attributes, $content, $block) } /** * Registers the `core/query-no-results` block on the server. + * + * @since 6.0.0 */ function register_block_core_query_no_results() { @@ -98006,6 +100003,10 @@ function register_block_core_query_no_results() /** * Renders the `core/query-pagination-next` block on the server. * + * @since 5.8.0 + * + * @global WP_Query $wp_query WordPress Query object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -98017,6 +100018,8 @@ function render_block_core_query_pagination_next($attributes, $content, $block) } /** * Registers the `core/query-pagination-next` block on the server. + * + * @since 5.8.0 */ function register_block_core_query_pagination_next() { @@ -98029,6 +100032,10 @@ function register_block_core_query_pagination_next() /** * Renders the `core/query-pagination-numbers` block on the server. * + * @since 5.8.0 + * + * @global WP_Query $wp_query WordPress Query object. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -98040,6 +100047,8 @@ function render_block_core_query_pagination_numbers($attributes, $content, $bloc } /** * Registers the `core/query-pagination-numbers` block on the server. + * + * @since 5.8.0 */ function register_block_core_query_pagination_numbers() { @@ -98052,6 +100061,8 @@ function register_block_core_query_pagination_numbers() /** * Renders the `core/query-pagination-previous` block on the server. * + * @since 5.8.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -98063,6 +100074,8 @@ function render_block_core_query_pagination_previous($attributes, $content, $blo } /** * Registers the `core/query-pagination-previous` block on the server. + * + * @since 5.8.0 */ function register_block_core_query_pagination_previous() { @@ -98075,6 +100088,8 @@ function register_block_core_query_pagination_previous() /** * Renders the `core/query-pagination` block on the server. * + * @since 5.9.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @@ -98085,6 +100100,8 @@ function render_block_core_query_pagination($attributes, $content) } /** * Registers the `core/query-pagination` block on the server. + * + * @since 5.8.0 */ function register_block_core_query_pagination() { @@ -98099,6 +100116,8 @@ function register_block_core_query_pagination() * For now it only supports Archive title, * using queried object information * + * @since 5.8.0 + * * @param array $attributes Block attributes. * * @return string Returns the query title based on the queried object. @@ -98108,6 +100127,8 @@ function render_block_core_query_title($attributes) } /** * Registers the `core/query-title` block on the server. + * + * @since 5.8.0 */ function register_block_core_query_title() { @@ -98133,6 +100154,8 @@ function render_block_core_query($attributes, $content, $block) } /** * Registers the `core/query` block on the server. + * + * @since 5.8.0 */ function register_block_core_query() { @@ -98159,6 +100182,8 @@ function block_core_query_disable_enhanced_pagination($parsed_block) /** * Renders the `core/read-more` block on the server. * + * @since 6.0.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -98169,6 +100194,8 @@ function render_block_core_read_more($attributes, $content, $block) } /** * Registers the `core/read-more` block on the server. + * + * @since 6.0.0 */ function register_block_core_read_more() { @@ -98181,6 +100208,8 @@ function register_block_core_read_more() /** * Renders the `core/rss` block on server. * + * @since 5.2.0 + * * @param array $attributes The block attributes. * * @return string Returns the block content with received rss items. @@ -98190,6 +100219,8 @@ function render_block_core_rss($attributes) } /** * Registers the `core/rss` block on server. + * + * @since 5.2.0 */ function register_block_core_rss() { @@ -98215,6 +100246,8 @@ function render_block_core_search($attributes) } /** * Registers the `core/search` block on the server. + * + * @since 5.2.0 */ function register_block_core_search() { @@ -98222,6 +100255,8 @@ function register_block_core_search() /** * Builds the correct top level classnames for the 'core/search' block. * + * @since 5.6.0 + * * @param array $attributes The block attributes. * * @return string The classnames used in the block. @@ -98235,6 +100270,8 @@ function classnames_for_block_core_search($attributes) * or not, the generated rule is injected into the appropriate collection of * styles for later application in the block's markup. * + * @since 6.1.0 + * * @param array $attributes The block attributes. * @param string $property Border property to generate rule for e.g. width or color. * @param string $side Optional side border. The dictates the value retrieved and final CSS property. @@ -98251,6 +100288,8 @@ function apply_block_core_search_border_style($attributes, $property, $side, &$w * injects rules into the provided wrapper, button and input style arrays for * uniform "flat" borders or those with individual sides configured. * + * @since 6.1.0 + * * @param array $attributes The block attributes. * @param string $property Border property to generate rule for e.g. width or color. * @param array $wrapper_styles Current collection of wrapper styles. @@ -98267,6 +100306,8 @@ function apply_block_core_search_border_styles($attributes, $property, &$wrapper * inner input or button and a second for the inner wrapper should the block * be positioning the button "inside". * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return array Style HTML attribute. @@ -98275,7 +100316,9 @@ function styles_for_block_core_search($attributes) { } /** - * Returns typography classnames depending on whether there are named font sizes/families . + * Returns typography classnames depending on whether there are named font sizes/families. + * + * @since 6.1.0 * * @param array $attributes The block attributes. * @@ -98288,6 +100331,8 @@ function get_typography_classes_for_block_core_search($attributes) * Returns typography styles to be included in an HTML style tag. * This excludes text-decoration, which is applied only to the label and button elements of the search block. * + * @since 6.1.0 + * * @param array $attributes The block attributes. * * @return string A string of typography CSS declarations. @@ -98298,6 +100343,8 @@ function get_typography_styles_for_block_core_search($attributes) /** * Returns border color classnames depending on whether there are named or custom border colors. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * * @return string The border color classnames to be applied to the block elements. @@ -98308,6 +100355,8 @@ function get_border_color_classes_for_block_core_search($attributes) /** * Returns color classnames depending on whether there are named or custom text and background colors. * + * @since 5.9.0 + * * @param array $attributes The block attributes. * * @return string The color classnames to be applied to the block elements. @@ -98323,6 +100372,8 @@ function get_color_classes_for_block_core_search($attributes) /** * Performs wpautop() on the shortcode block content. * + * @since 5.0.0 + * * @param array $attributes The block attributes. * @param string $content The block content. * @@ -98333,6 +100384,8 @@ function render_block_core_shortcode($attributes, $content) } /** * Registers the `core/shortcode` block on server. + * + * @since 5.0.0 */ function register_block_core_shortcode() { @@ -98345,6 +100398,8 @@ function register_block_core_shortcode() /** * Renders the `core/site-logo` block on the server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return string The render. @@ -98354,18 +100409,24 @@ function render_block_core_site_logo($attributes) } /** * Register a core site setting for a site logo + * + * @since 5.8.0 */ function register_block_core_site_logo_setting() { } /** * Register a core site setting for a site icon + * + * @since 5.9.0 */ function register_block_core_site_icon_setting() { } /** * Registers the `core/site-logo` block on the server. + * + * @since 5.8.0 */ function register_block_core_site_logo() { @@ -98373,6 +100434,8 @@ function register_block_core_site_logo() /** * Overrides the custom logo with a site logo, if the option is set. * + * @since 5.8.0 + * * @param string $custom_logo The custom logo set by a theme. * * @return string The site logo if set. @@ -98383,6 +100446,8 @@ function _override_custom_logo_theme_mod($custom_logo) /** * Updates the site_logo option when the custom_logo theme-mod gets updated. * + * @since 5.8.0 + * * @param mixed $value Attachment ID of the custom logo or an empty value. * @return mixed */ @@ -98392,6 +100457,8 @@ function _sync_custom_logo_to_site_logo($value) /** * Deletes the site_logo when the custom_logo theme mod is removed. * + * @since 5.8.0 + * * @param array $old_value Previous theme mod settings. * @param array $value Updated theme mod settings. * @phpstan-return void @@ -98401,6 +100468,8 @@ function _delete_site_logo_on_remove_custom_logo($old_value, $value) } /** * Deletes the site logo when all theme mods are being removed. + * + * @since 5.8.0 * @phpstan-return void */ function _delete_site_logo_on_remove_theme_mods() @@ -98411,12 +100480,16 @@ function _delete_site_logo_on_remove_theme_mods() * Hooks `_delete_site_logo_on_remove_theme_mods` in `delete_option_theme_mods_$theme`. * * Runs on `setup_theme` to account for dynamically-switched themes in the Customizer. + * + * @since 5.8.0 */ function _delete_site_logo_on_remove_custom_logo_on_setup_theme() { } /** * Removes the custom_logo theme-mod when the site_logo option gets deleted. + * + * @since 5.9.0 */ function _delete_custom_logo_on_remove_site_logo() { @@ -98429,6 +100502,8 @@ function _delete_custom_logo_on_remove_site_logo() /** * Renders the `core/site-tagline` block on the server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return string The render. @@ -98438,6 +100513,8 @@ function render_block_core_site_tagline($attributes) } /** * Registers the `core/site-tagline` block on the server. + * + * @since 5.8.0 */ function register_block_core_site_tagline() { @@ -98450,6 +100527,8 @@ function register_block_core_site_tagline() /** * Renders the `core/site-title` block on the server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return string The render. @@ -98459,6 +100538,8 @@ function render_block_core_site_title($attributes) } /** * Registers the `core/site-title` block on the server. + * + * @since 5.8.0 */ function register_block_core_site_title() { @@ -98471,6 +100552,8 @@ function register_block_core_site_title() /** * Renders the `core/social-link` block on server. * + * @since 5.4.0 + * * @param Array $attributes The block attributes. * @param String $content InnerBlocks content of the Block. * @param WP_Block $block Block object. @@ -98482,6 +100565,8 @@ function render_block_core_social_link($attributes, $content, $block) } /** * Registers the `core/social-link` blocks. + * + * @since 5.4.0 */ function register_block_core_social_link() { @@ -98489,6 +100574,8 @@ function register_block_core_social_link() /** * Returns the SVG for social link. * + * @since 5.4.0 + * * @param string $service The service icon. * * @return string SVG Element for service icon. @@ -98499,6 +100586,8 @@ function block_core_social_link_get_icon($service) /** * Returns the brand name for social link. * + * @since 5.4.0 + * * @param string $service The service icon. * * @return string Brand label. @@ -98509,6 +100598,8 @@ function block_core_social_link_get_name($service) /** * Returns the SVG for social link. * + * @since 5.4.0 + * * @param string $service The service slug to extract data from. * @param string $field The field ('name', 'icon', etc) to extract for a service. * @@ -98520,6 +100611,8 @@ function block_core_social_link_services($service = '', $field = '') /** * Returns CSS styles for icon and icon background colors. * + * @since 5.7.0 + * * @param array $context Block context passed to Social Link. * * @return string Inline CSS styles for link's icon and background colors. @@ -98530,6 +100623,8 @@ function block_core_social_link_get_color_styles($context) /** * Returns CSS classes for icon and icon background colors. * + * @since 6.3.0 + * * @param array $context Block context passed to Social Sharing Link. * * @return string CSS classes for link's icon and background colors. @@ -98545,6 +100640,8 @@ function block_core_social_link_get_color_classes($context) /** * Renders the `core/tag-cloud` block on server. * + * @since 5.2.0 + * * @param array $attributes The block attributes. * * @return string Returns the tag cloud for selected taxonomy. @@ -98554,6 +100651,8 @@ function render_block_core_tag_cloud($attributes) } /** * Registers the `core/tag-cloud` block on server. + * + * @since 5.2.0 */ function register_block_core_tag_cloud() { @@ -98566,6 +100665,10 @@ function register_block_core_tag_cloud() /** * Renders the `core/template-part` block on the server. * + * @since 5.9.0 + * + * @global WP_Embed $wp_embed WordPress Embed object. + * * @param array $attributes The block attributes. * * @return string The render. @@ -98576,6 +100679,8 @@ function render_block_core_template_part($attributes) /** * Returns an array of area variation objects for the template part block. * + * @since 6.1.0 + * * @param array $instance_variations The variations for instances. * * @return array Array containing the block variation objects. @@ -98586,6 +100691,8 @@ function build_template_part_block_area_variations($instance_variations) /** * Returns an array of instance variation objects for the template part block * + * @since 6.1.0 + * * @return array Array containing the block variation objects. */ function build_template_part_block_instance_variations() @@ -98594,6 +100701,8 @@ function build_template_part_block_instance_variations() /** * Returns an array of all template part block variations. * + * @since 5.9.0 + * * @return array Array containing the block variation objects. */ function build_template_part_block_variations() @@ -98601,6 +100710,8 @@ function build_template_part_block_variations() } /** * Registers the `core/template-part` block on the server. + * + * @since 5.9.0 */ function register_block_core_template_part() { @@ -98613,6 +100724,8 @@ function register_block_core_template_part() /** * Renders the `core/term-description` block on the server. * + * @since 5.9.0 + * * @param array $attributes Block attributes. * * @return string Returns the description of the current taxonomy term, if available @@ -98622,6 +100735,8 @@ function render_block_core_term_description($attributes) } /** * Registers the `core/term-description` block on the server. + * + * @since 5.9.0 */ function register_block_core_term_description() { @@ -98634,6 +100749,11 @@ function register_block_core_term_description() /** * Renders the 'core/widget-group' block. * + * @since 5.9.0 + * + * @global array $wp_registered_sidebars + * @global int|string $_sidebar_being_rendered + * * @param array $attributes The block attributes. * @param string $content The block content. * @param WP_Block $block The block. @@ -98645,6 +100765,8 @@ function render_block_core_widget_group($attributes, $content, $block) } /** * Registers the 'core/widget-group' block. + * + * @since 5.9.0 */ function register_block_core_widget_group() { @@ -98654,6 +100776,10 @@ function register_block_core_widget_group() * it. This lets us get to the current sidebar in * render_block_core_widget_group(). * + * @since 5.9.0 + * + * @global int|string $_sidebar_being_rendered + * * @param int|string $index Index, name, or ID of the dynamic sidebar. */ function note_sidebar_being_rendered($index) @@ -98662,6 +100788,10 @@ function note_sidebar_being_rendered($index) /** * Clear whatever we set in note_sidebar_being_rendered() after WordPress * finishes rendering a sidebar. + * + * @since 5.9.0 + * + * @global int|string $_sidebar_being_rendered */ function discard_sidebar_being_rendered() { @@ -103433,14 +105563,14 @@ function _wp_cron() * one is 'interval' and the other is 'display'. * * The 'interval' is a number in seconds of when the cron job should run. - * So for 'hourly' the time is `HOUR_IN_SECONDS` (60 * 60 or 3600). For 'monthly', - * the value would be `MONTH_IN_SECONDS` (30 * 24 * 60 * 60 or 2592000). + * So for 'hourly' the time is `HOUR_IN_SECONDS` (`60 * 60` or `3600`). For 'monthly', + * the value would be `MONTH_IN_SECONDS` (`30 * 24 * 60 * 60` or `2592000`). * * The 'display' is the description. For the 'monthly' key, the 'display' * would be `__( 'Once Monthly' )`. * - * For your plugin, you will be passed an array. You can easily add your - * schedule by doing the following. + * For your plugin, you will be passed an array. You can add your + * schedule by doing the following: * * // Filter parameter variable name is 'array'. * $array['monthly'] = array( @@ -105329,7 +107459,7 @@ function get_user_metavalues($ids) /** * Sanitize every user field. * - * If the context is 'raw', then the user object or array will get minimal santization of the int fields. + * If the context is 'raw', then the user object or array will get minimal sanitization of the int fields. * * @since 2.3.0 * @deprecated 3.3.0 @@ -107049,8 +109179,6 @@ function the_block_template_skip_link() * * @since 6.4.0 * @deprecated 6.5.0 - * - * @global WP_Scripts $wp_scripts */ function block_core_query_ensure_interactivity_dependency() { @@ -107060,8 +109188,6 @@ function block_core_query_ensure_interactivity_dependency() * * @since 6.4.0 * @deprecated 6.5.0 - * - * @global WP_Scripts $wp_scripts */ function block_core_file_ensure_interactivity_dependency() { @@ -107071,12 +109197,43 @@ function block_core_file_ensure_interactivity_dependency() * * @since 6.4.0 * @deprecated 6.5.0 - * - * @global WP_Scripts $wp_scripts */ function block_core_image_ensure_interactivity_dependency() { } + /** + * Updates the block content with elements class names. + * + * @deprecated 6.6.0 Generation of element class name is handled via `render_block_data` filter. + * + * @since 5.8.0 + * @since 6.4.0 Added support for button and heading element styling. + * @access private + * + * @param string $block_content Rendered block content. + * @param array $block Block object. + * @return string Filtered block content. + */ + function wp_render_elements_support($block_content, $block) + { + } + /** + * Processes the directives on the rendered HTML of the interactive blocks. + * + * This processes only one root interactive block at a time because the + * rendered HTML of that block contains the rendered HTML of all its inner + * blocks, including any interactive block. It does so by ignoring all the + * interactive inner blocks until the root interactive block is processed. + * + * @since 6.5.0 + * @deprecated 6.6.0 + * + * @param array $parsed_block The parsed block. + * @return array The same parsed block. + */ + function wp_interactivity_process_directives_of_interactive_blocks(array $parsed_block) : array + { + } /** * oEmbed API: Top-level oEmbed functionality * @@ -107091,7 +109248,7 @@ function block_core_image_ensure_interactivity_dependency() * * @since 2.9.0 * - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * * @param string $id An internal ID/name for the handler. Needs to be unique. * @param string $regex The regex that will be used to see if this handler should be used for a URL. @@ -107107,7 +109264,7 @@ function wp_embed_register_handler($id, $regex, $callback, $priority = 10) * * @since 2.9.0 * - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * * @param string $id The handler ID that should be removed. * @param int $priority Optional. The priority of the handler to be removed. Default 10. @@ -107231,7 +109388,7 @@ function wp_maybe_load_embeds() * * @since 4.0.0 * - * @global WP_Embed $wp_embed + * @global WP_Embed $wp_embed WordPress Embed object. * * @param array $matches The RegEx matches from the provided regex when calling * wp_embed_register_handler(). @@ -107756,10 +109913,12 @@ function wp_title_rss($deprecated = '–') * Retrieves the current post title for the feed. * * @since 2.0.0 + * @since 6.6.0 Added the `$post` parameter. * + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @return string Current post title. */ - function get_the_title_rss() + function get_the_title_rss($post = 0) { } /** @@ -108011,10 +110170,10 @@ function self_link() * If viewing a comment feed, the time of the most recently modified * comment will be returned. * - * @global WP_Query $wp_query WordPress Query object. - * * @since 5.2.0 * + * @global WP_Query $wp_query WordPress Query object. + * * @param string $format Date format string to return the time in. * @return string|false The time in requested format, or false on failure. */ @@ -108060,11 +110219,13 @@ function fetch_feed($url) * @param array[][] $fonts { * Optional. The font-families and their font faces. Default empty array. * - * @type array { + * @type array ...$0 { * An indexed or associative (keyed by font-family) array of font variations for this font-family. * Each font face has the following structure. * - * @type array { + * @type array ...$0 { + * The font face properties. + * * @type string $font-family The font-family property. * @type string|string[] $src The URL(s) to each resource containing the font data. * @type string $font-style Optional. The font-style property. Default 'normal'. @@ -108082,6 +110243,24 @@ function fetch_feed($url) * } * } * } + * @phpstan-param array[], + * }> $fonts * @phpstan-return void */ function wp_print_font_faces($fonts = array()) @@ -110927,6 +113106,7 @@ function wp($query_vars = '') * @since 3.9.0 Added status codes 418, 428, 429, 431, and 511. * @since 4.5.0 Added status codes 308, 421, and 451. * @since 5.1.0 Added status code 103. + * @since 6.6.0 Added status code 425. * * @global array $wp_header_to_desc * @@ -111324,7 +113504,7 @@ function wp_is_writable($path) * PHP has issues with Windows ACL's for determine if a * directory is writable or not, this works around them by * checking the ability to open files rather than relying - * upon PHP to interprate the OS ACL. + * upon PHP to interpret the OS ACL. * * @since 2.8.0 * @@ -111375,10 +113555,10 @@ function wp_get_upload_dir() * @since 2.0.0 * @uses _wp_upload_dir() * - * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. - * @param bool $create_dir Optional. Whether to check and create the uploads directory. - * Default true for backward compatibility. - * @param bool $refresh_cache Optional. Whether to refresh the cache. Default false. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @param bool $create_dir Optional. Whether to check and create the uploads directory. + * Default true for backward compatibility. + * @param bool $refresh_cache Optional. Whether to refresh the cache. Default false. * @return array { * Array of information about the upload directory. * @@ -111407,7 +113587,7 @@ function wp_upload_dir($time = \null, $create_dir = \true, $refresh_cache = \fal * @since 4.5.0 * @access private * - * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array See wp_upload_dir() */ function _wp_upload_dir($time = \null) @@ -111481,7 +113661,7 @@ function _wp_check_existing_file_names($filename, $files) * @param string $name Filename. * @param null|string $deprecated Never used. Set to null. * @param string $bits File content - * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array { * Information about the newly-uploaded file. * @@ -112106,10 +114286,10 @@ function wp_is_serving_rest_request() * the description. Probably should create a Codex page for it, so that it is * available. * + * @since 2.2.0 + * * @global array $wpsmiliestrans * @global array $wp_smiliessearch - * - * @since 2.2.0 * @phpstan-return void */ function smilies_init() @@ -113220,6 +115400,35 @@ function wp_auth_check($response) function get_tag_regex($tag) { } + /** + * Indicates if a given slug for a character set represents the UTF-8 + * text encoding. If not provided, examines the current blog's charset. + * + * A charset is considered to represent UTF-8 if it is a case-insensitive + * match of "UTF-8" with or without the hyphen. + * + * Example: + * + * true === is_utf8_charset( 'UTF-8' ); + * true === is_utf8_charset( 'utf8' ); + * false === is_utf8_charset( 'latin1' ); + * false === is_utf8_charset( 'UTF 8' ); + * + * // Only strings match. + * false === is_utf8_charset( [ 'charset' => 'utf-8' ] ); + * + * // Without a given charset, it depends on the site option "blog_charset". + * $is_utf8 = is_utf8_charset(); + * + * @since 6.6.0 + * + * @param ?string $blog_charset Slug representing a text character encoding, or "charset". + * E.g. "UTF-8", "Windows-1252", "ISO-8859-1", "SJIS". + * @return bool Whether the slug represents the UTF-8 encoding. + */ + function is_utf8_charset($blog_charset = \null) + { + } /** * Retrieves a canonical form of the provided charset appropriate for passing to PHP * functions such as htmlspecialchars() and charset HTML attributes. @@ -113229,7 +115438,7 @@ function get_tag_regex($tag) * * @see https://core.trac.wordpress.org/ticket/23688 * - * @param string $charset A charset name. + * @param string $charset A charset name, e.g. "UTF-8", "Windows-1252", "SJIS". * @return string The canonical form of the charset. */ function _canonical_charset($charset) @@ -113817,10 +116026,10 @@ function wp_admin_notice($message, $args = array()) /** * Initializes $wp_scripts if it has not been set. * - * @global WP_Scripts $wp_scripts - * * @since 4.2.0 * + * @global WP_Scripts $wp_scripts + * * @return WP_Scripts WP_Scripts instance. */ function wp_scripts() @@ -113850,10 +116059,10 @@ function _wp_scripts_maybe_doing_it_wrong($function_name, $handle = '') * hook to register/enqueue new scripts. * * @see WP_Scripts::do_item() - * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. - * * @since 2.1.0 * + * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. + * * @param string|string[]|false $handles Optional. Scripts to be printed. Default 'false'. * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array. */ @@ -113952,11 +116161,11 @@ function wp_localize_script($handle, $object_name, $l10n) * Works only if the script has already been registered. * * @see WP_Scripts::set_translations() - * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. - * * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * + * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. + * * @param string $handle Script handle the textdomain will be attached to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. @@ -114080,10 +116289,10 @@ function wp_script_add_data($handle, $key, $value) /** * Initializes $wp_styles if it has not been set. * - * @global WP_Styles $wp_styles - * * @since 4.2.0 * + * @global WP_Styles $wp_styles + * * @return WP_Styles WP_Styles instance. */ function wp_styles() @@ -114096,10 +116305,10 @@ function wp_styles() * passing an array with one string prints that style, * and passing an array of strings prints those styles. * - * @global WP_Styles $wp_styles The WP_Styles object for printing styles. - * * @since 2.6.0 * + * @global WP_Styles $wp_styles The WP_Styles object for printing styles. + * * @param string|bool|array $handles Styles to be printed. Default 'false'. * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array. */ @@ -114437,27 +116646,32 @@ function wp_registration_url() * The login form HTML is echoed by default. Pass a false value for `$echo` to return it instead. * * @since 3.0.0 + * @since 6.6.0 Added `required_username` and `required_password` arguments. * * @param array $args { * Optional. Array of options to control the form output. Default empty array. * - * @type bool $echo Whether to display the login form or return the form HTML code. - * Default true (echo). - * @type string $redirect URL to redirect to. Must be absolute, as in "https://example.com/mypage/". - * Default is to redirect back to the request URI. - * @type string $form_id ID attribute value for the form. Default 'loginform'. - * @type string $label_username Label for the username or email address field. Default 'Username or Email Address'. - * @type string $label_password Label for the password field. Default 'Password'. - * @type string $label_remember Label for the remember field. Default 'Remember Me'. - * @type string $label_log_in Label for the submit button. Default 'Log In'. - * @type string $id_username ID attribute value for the username field. Default 'user_login'. - * @type string $id_password ID attribute value for the password field. Default 'user_pass'. - * @type string $id_remember ID attribute value for the remember field. Default 'rememberme'. - * @type string $id_submit ID attribute value for the submit button. Default 'wp-submit'. - * @type bool $remember Whether to display the "rememberme" checkbox in the form. - * @type string $value_username Default value for the username field. Default empty. - * @type bool $value_remember Whether the "Remember Me" checkbox should be checked by default. - * Default false (unchecked). + * @type bool $echo Whether to display the login form or return the form HTML code. + * Default true (echo). + * @type string $redirect URL to redirect to. Must be absolute, as in "https://example.com/mypage/". + * Default is to redirect back to the request URI. + * @type string $form_id ID attribute value for the form. Default 'loginform'. + * @type string $label_username Label for the username or email address field. Default 'Username or Email Address'. + * @type string $label_password Label for the password field. Default 'Password'. + * @type string $label_remember Label for the remember field. Default 'Remember Me'. + * @type string $label_log_in Label for the submit button. Default 'Log In'. + * @type string $id_username ID attribute value for the username field. Default 'user_login'. + * @type string $id_password ID attribute value for the password field. Default 'user_pass'. + * @type string $id_remember ID attribute value for the remember field. Default 'rememberme'. + * @type string $id_submit ID attribute value for the submit button. Default 'wp-submit'. + * @type bool $remember Whether to display the "rememberme" checkbox in the form. + * @type string $value_username Default value for the username field. Default empty. + * @type bool $value_remember Whether the "Remember Me" checkbox should be checked by default. + * Default false (unchecked). + * @type bool $required_username Whether the username field has the 'required' attribute. + * Default false. + * @type bool $required_password Whether the password field has the 'required' attribute. + * Default false. * * } * @return void|string Void if 'echo' argument is true, login form HTML if 'echo' is false. @@ -114476,6 +116690,8 @@ function wp_registration_url() * remember?: bool, * value_username?: string, * value_remember?: bool, + * required_username?: bool, + * required_password?: bool, * } $args */ function wp_login_form($args = array()) @@ -116036,6 +118252,7 @@ function wp_get_global_styles($path = array(), $context = array()) * * @since 5.9.0 * @since 6.1.0 Added 'base-layout-styles' support. + * @since 6.6.0 Resolves relative paths in theme.json styles to theme absolute paths. * * @param array $types Optional. Types of styles to load. * It accepts as values 'variables', 'presets', 'styles', 'base-layout-styles'. @@ -116166,15 +118383,19 @@ function _wp_http_get_object() { } /** - * Retrieve the raw response from a safe HTTP request. + * Retrieves the raw response from a safe HTTP request. * * This function is ideal when the HTTP request is being made to an arbitrary - * URL. The URL is validated to avoid redirection and request forgery attacks. + * URL. The URL, and every URL it redirects to, are validated with wp_http_validate_url() + * to avoid Server Side Request Forgery attacks (SSRF). * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. + * @see wp_http_validate_url() For more information about how the URL is validated. + * + * @link https://owasp.org/www-community/attacks/Server_Side_Request_Forgery * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. @@ -116205,15 +118426,19 @@ function wp_safe_remote_request($url, $args = array()) { } /** - * Retrieve the raw response from a safe HTTP request using the GET method. + * Retrieves the raw response from a safe HTTP request using the GET method. * * This function is ideal when the HTTP request is being made to an arbitrary - * URL. The URL is validated to avoid redirection and request forgery attacks. + * URL. The URL, and every URL it redirects to, are validated with wp_http_validate_url() + * to avoid Server Side Request Forgery attacks (SSRF). * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. + * @see wp_http_validate_url() For more information about how the URL is validated. + * + * @link https://owasp.org/www-community/attacks/Server_Side_Request_Forgery * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. @@ -116244,15 +118469,19 @@ function wp_safe_remote_get($url, $args = array()) { } /** - * Retrieve the raw response from a safe HTTP request using the POST method. + * Retrieves the raw response from a safe HTTP request using the POST method. * * This function is ideal when the HTTP request is being made to an arbitrary - * URL. The URL is validated to avoid redirection and request forgery attacks. + * URL. The URL, and every URL it redirects to, are validated with wp_http_validate_url() + * to avoid Server Side Request Forgery attacks (SSRF). * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. + * @see wp_http_validate_url() For more information about how the URL is validated. + * + * @link https://owasp.org/www-community/attacks/Server_Side_Request_Forgery * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. @@ -116283,15 +118512,19 @@ function wp_safe_remote_post($url, $args = array()) { } /** - * Retrieve the raw response from a safe HTTP request using the HEAD method. + * Retrieves the raw response from a safe HTTP request using the HEAD method. * * This function is ideal when the HTTP request is being made to an arbitrary - * URL. The URL is validated to avoid redirection and request forgery attacks. + * URL. The URL, and every URL it redirects to, are validated with wp_http_validate_url() + * to avoid Server Side Request Forgery attacks (SSRF). * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. + * @see wp_http_validate_url() For more information about how the URL is validated. + * + * @link https://owasp.org/www-community/attacks/Server_Side_Request_Forgery * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. @@ -116494,7 +118727,7 @@ function wp_remote_head($url, $args = array()) { } /** - * Retrieve only the headers from the raw response. + * Retrieves only the headers from the raw response. * * @since 2.7.0 * @since 4.6.0 Return value changed from an array to an WpOrg\Requests\Utility\CaseInsensitiveDictionary instance. @@ -116509,7 +118742,7 @@ function wp_remote_retrieve_headers($response) { } /** - * Retrieve a single header by name from the raw response. + * Retrieves a single header by name from the raw response. * * @since 2.7.0 * @@ -116522,7 +118755,7 @@ function wp_remote_retrieve_header($response, $header) { } /** - * Retrieve only the response code from the raw response. + * Retrieves only the response code from the raw response. * * Will return an empty string if incorrect parameter value is given. * @@ -116535,7 +118768,7 @@ function wp_remote_retrieve_response_code($response) { } /** - * Retrieve only the response message from the raw response. + * Retrieves only the response message from the raw response. * * Will return an empty string if incorrect parameter value is given. * @@ -116548,7 +118781,7 @@ function wp_remote_retrieve_response_message($response) { } /** - * Retrieve only the body from the raw response. + * Retrieves only the body from the raw response. * * @since 2.7.0 * @@ -116559,7 +118792,7 @@ function wp_remote_retrieve_body($response) { } /** - * Retrieve only the cookies from the raw response. + * Retrieves only the cookies from the raw response. * * @since 4.4.0 * @@ -116571,7 +118804,7 @@ function wp_remote_retrieve_cookies($response) { } /** - * Retrieve a single cookie by name from the raw response. + * Retrieves a single cookie by name from the raw response. * * @since 4.4.0 * @@ -116584,7 +118817,7 @@ function wp_remote_retrieve_cookie($response, $name) { } /** - * Retrieve a single cookie's value by name from the raw response. + * Retrieves a single cookie's value by name from the raw response. * * @since 4.4.0 * @@ -116611,7 +118844,7 @@ function wp_http_supports($capabilities = array(), $url = \null) { } /** - * Get the HTTP Origin of the current request. + * Gets the HTTP Origin of the current request. * * @since 3.4.0 * @@ -116621,7 +118854,7 @@ function get_http_origin() { } /** - * Retrieve list of allowed HTTP origins. + * Retrieves list of allowed HTTP origins. * * @since 3.4.0 * @@ -116642,7 +118875,7 @@ function is_allowed_http_origin($origin = \null) { } /** - * Send Access-Control-Allow-Origin and related headers if the current request + * Sends Access-Control-Allow-Origin and related headers if the current request * is from an allowed origin. * * If the request is an OPTIONS request, the script exits with either access @@ -116658,7 +118891,21 @@ function send_origin_headers() { } /** - * Validate a URL for safe use in the HTTP API. + * Validates a URL for safe use in the HTTP API. + * + * Examples of URLs that are considered unsafe: + * + * - ftp://example.com/caniload.php - Invalid protocol - only http and https are allowed. + * - http:///example.com/caniload.php - Malformed URL. + * - http://user:pass@example.com/caniload.php - Login information. + * - http://exampleeeee.com/caniload.php - Invalid hostname, as the IP cannot be looked up in DNS. + * + * Examples of URLs that are considered unsafe by default: + * + * - http://192.168.0.1/caniload.php - IPs from LAN networks. + * This can be changed with the {@see 'http_request_host_is_external'} filter. + * - http://198.143.164.252:81/caniload.php - By default, only 80, 443, and 8080 ports are allowed. + * This can be changed with the {@see 'http_allowed_safe_ports'} filter. * * @since 3.5.2 * @@ -116669,7 +118916,7 @@ function wp_http_validate_url($url) { } /** - * Mark allowed redirect hosts safe for HTTP requests as well. + * Marks allowed redirect hosts safe for HTTP requests as well. * * Attached to the {@see 'http_request_host_is_external'} filter. * @@ -116728,7 +118975,7 @@ function wp_parse_url($url, $component = -1) { } /** - * Retrieve a specific component from a parsed URL array. + * Retrieves a specific component from a parsed URL array. * * @internal * @@ -116750,7 +118997,7 @@ function _get_component_from_parsed_url_array($url_parts, $component = -1) { } /** - * Translate a PHP_URL_* constant to the named array keys PHP uses. + * Translates a PHP_URL_* constant to the named array keys PHP uses. * * @internal * @@ -116918,22 +119165,6 @@ function wp_update_https_migration_required($old_url, $new_url) * @subpackage Interactivity API * @since 6.5.0 */ - /** - * Processes the directives on the rendered HTML of the interactive blocks. - * - * This processes only one root interactive block at a time because the - * rendered HTML of that block contains the rendered HTML of all its inner - * blocks, including any interactive block. It does so by ignoring all the - * interactive inner blocks until the root interactive block is processed. - * - * @since 6.5.0 - * - * @param array $parsed_block The parsed block. - * @return array The same parsed block. - */ - function wp_interactivity_process_directives_of_interactive_blocks(array $parsed_block) : array - { - } /** * Retrieves the main WP_Interactivity_API instance. * @@ -116968,7 +119199,11 @@ function wp_interactivity_process_directives(string $html) : string * If state for that store namespace already exists, it merges the new * provided state with the existing one. * + * The namespace can be omitted inside derived state getters, using the + * namespace where the getter is defined. + * * @since 6.5.0 + * @since 6.6.0 The namespace can be omitted when called inside derived state getters. * * @param string $store_namespace The unique store namespace identifier. * @param array $state Optional. The array that will be merged with the existing state for the specified @@ -116976,7 +119211,7 @@ function wp_interactivity_process_directives(string $html) : string * @return array The state for the specified store namespace. This will be the updated state if a $state argument was * provided. */ - function wp_interactivity_state(string $store_namespace, array $state = array()) : array + function wp_interactivity_state(?string $store_namespace = \null, array $state = array()) : array { } /** @@ -117019,6 +119254,23 @@ function wp_interactivity_config(string $store_namespace, array $config = array( function wp_interactivity_data_wp_context(array $context, string $store_namespace = '') : string { } + /** + * Gets the current Interactivity API context for a given namespace. + * + * The function should be used only during directive processing. If the + * `$store_namespace` parameter is omitted, it uses the current namespace value + * on the internal namespace stack. + * + * It returns an empty array when the specified namespace is not defined. + * + * @since 6.6.0 + * + * @param string $store_namespace Optional. The unique store namespace identifier. + * @return array The context for the specified store namespace. + */ + function wp_interactivity_get_context(?string $store_namespace = \null) : array + { + } function get_file($path) { } @@ -117112,6 +119364,7 @@ function wp_kses_version() * It also matches stray `>` characters. * * @since 1.0.0 + * @since 6.6.0 Recognize additional forms of invalid HTML which convert into comments. * * @global array[]|string $pass_allowed_html An array of allowed HTML elements and attributes, * or a context name such as 'post'. @@ -117176,12 +119429,14 @@ function _wp_kses_split_callback($matches) * @access private * @ignore * @since 1.0.0 + * @since 6.6.0 Recognize additional forms of invalid HTML which convert into comments. * * @param string $content Content to filter. * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, * or a context name such as 'post'. See wp_kses_allowed_html() * for the list of accepted context names. * @param string[] $allowed_protocols Array of allowed URL protocols. + * * @return string Fixed HTML element */ function wp_kses_split2($content, $allowed_html, $allowed_protocols) @@ -117708,6 +119963,7 @@ function kses_init() * Added support for `box-shadow`. * @since 6.4.0 Added support for `writing-mode`. * @since 6.5.0 Added support for `background-repeat`. + * @since 6.6.0 Added support for `grid-column`, `grid-row`, and `container-type`. * * @param string $css A string of CSS rules. * @param string $deprecated Not used. @@ -118446,6 +120702,8 @@ function get_available_languages($dir = \null) * * @since 3.7.0 * + * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. + * * @param string $type What to search for. Accepts 'plugins', 'themes', 'core'. * @return array Array of language data. */ @@ -118463,6 +120721,17 @@ function wp_get_installed_translations($type) function wp_get_pomo_file_data($po_file) { } + /** + * Extracts headers from a PHP translation file. + * + * @since 6.6.0 + * + * @param string $php_file Path to a `.l10n.php` file. + * @return string[] Array of file header values keyed by header name. + */ + function wp_get_l10n_php_file_data($php_file) + { + } /** * Displays or returns a Language selector. * @@ -118784,8 +121053,8 @@ function _get_page_link($post = \false, $leavename = \false, $sample = \false) * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * - * @param int|object $post Optional. Post ID or object. Default uses the global `$post`. - * @param bool $leavename Optional. Whether to keep the page name. Default false. + * @param int|WP_Post $post Optional. Post ID or object. Default uses the global `$post`. + * @param bool $leavename Optional. Whether to keep the page name. Default false. * @return string The attachment permalink. */ function get_attachment_link($post = \null, $leavename = \false) @@ -121875,19 +124144,21 @@ function wp_get_attachment_image_src($attachment_id, $size = 'thumbnail', $icon * @param string|array $attr { * Optional. Attributes for the image markup. * - * @type string $src Image attachment URL. - * @type string $class CSS class name or space-separated list of classes. - * Default `attachment-$size_class size-$size_class`, - * where `$size_class` is the image size being requested. - * @type string $alt Image description for the alt attribute. - * @type string $srcset The 'srcset' attribute value. - * @type string $sizes The 'sizes' attribute value. - * @type string|false $loading The 'loading' attribute value. Passing a value of false - * will result in the attribute being omitted for the image. - * Defaults to 'lazy', depending on wp_lazy_loading_enabled(). - * @type string $decoding The 'decoding' attribute value. Possible values are - * 'async' (default), 'sync', or 'auto'. Passing false or an empty - * string will result in the attribute being omitted. + * @type string $src Image attachment URL. + * @type string $class CSS class name or space-separated list of classes. + * Default `attachment-$size_class size-$size_class`, + * where `$size_class` is the image size being requested. + * @type string $alt Image description for the alt attribute. + * @type string $srcset The 'srcset' attribute value. + * @type string $sizes The 'sizes' attribute value. + * @type string|false $loading The 'loading' attribute value. Passing a value of false + * will result in the attribute being omitted for the image. + * Default determined by {@see wp_get_loading_optimization_attributes()}. + * @type string $decoding The 'decoding' attribute value. Possible values are + * 'async' (default), 'sync', or 'auto'. Passing false or an empty + * string will result in the attribute being omitted. + * @type string $fetchpriority The 'fetchpriority' attribute value, whether `high`, `low`, or `auto`. + * Default determined by {@see wp_get_loading_optimization_attributes()}. * } * @return string HTML img element or empty string on failure. * @phpstan-param array{ @@ -121898,6 +124169,7 @@ function wp_get_attachment_image_src($attachment_id, $size = 'thumbnail', $icon * sizes?: string, * loading?: string|false, * decoding?: string, + * fetchpriority?: string, * } $attr */ function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = \false, $attr = '') @@ -123060,7 +125332,7 @@ function wp_show_heic_upload_error($plupload_settings) * @param array $image_info Optional. Extended image information (passed by reference). * @return array|false Array of image information or false on failure. */ - function wp_getimagesize($filename, array &$image_info = \null) + function wp_getimagesize($filename, ?array &$image_info = \null) { } /** @@ -123070,12 +125342,18 @@ function wp_getimagesize($filename, array &$image_info = \null) * * @param string $filename Path to an AVIF file. * @return array { - * An array of AVIF image information. + * An array of AVIF image information. * - * @type int|false $width Image width on success, false on failure. - * @type int|false $height Image height on success, false on failure. - * @type int|false $bit_depth Image bit depth on success, false on failure. - * @type int|false $num_channels Image number of channels on success, false on failure. + * @type int|false $width Image width on success, false on failure. + * @type int|false $height Image height on success, false on failure. + * @type int|false $bit_depth Image bit depth on success, false on failure. + * @type int|false $num_channels Image number of channels on success, false on failure. + * } + * @phpstan-return array{ + * width: int|false, + * height: int|false, + * bit_depth: int|false, + * num_channels: int|false, * } */ function wp_get_avif_info($filename) @@ -123750,8 +126028,6 @@ function refresh_blog_details($blog_id = 0) * * @since MU (3.0.0) * - * @global wpdb $wpdb WordPress database abstraction object. - * * @param int $blog_id Blog ID. * @param array $details Array of details keyed by blogs table field names. * @return bool True if update succeeds, false otherwise. @@ -123852,7 +126128,7 @@ function update_blog_option($id, $option, $value, $deprecated = \null) * @global int $blog_id * @global array $_wp_switched_stack * @global bool $switched - * @global string $table_prefix + * @global string $table_prefix The database table prefix. * @global WP_Object_Cache $wp_object_cache * * @param int $new_blog_id The ID of the blog to switch to. Default: current blog. @@ -123872,7 +126148,7 @@ function switch_to_blog($new_blog_id, $deprecated = \null) * @global array $_wp_switched_stack * @global int $blog_id * @global bool $switched - * @global string $table_prefix + * @global string $table_prefix The database table prefix. * @global WP_Object_Cache $wp_object_cache * * @return bool True on success, false if we're already on the current blog. @@ -124198,7 +126474,7 @@ function clear_global_post_cache($post_id) { } /** - * Deprecated functionality to determin if the current site is the main site. + * Deprecated functionality to determine if the current site is the main site. * * @since MU (3.0.0) * @deprecated 3.0.0 Use is_main_site() @@ -127006,13 +129282,46 @@ function form_option($option) function wp_load_alloptions($force_cache = \false) { } + /** + * Primes specific network options for the current network into the cache with a single database query. + * + * Only network options that do not already exist in cache will be loaded. + * + * If site is not multisite, then call wp_prime_option_caches(). + * + * @since 6.6.0 + * + * @see wp_prime_network_option_caches() + * + * @param string[] $options An array of option names to be loaded. + */ + function wp_prime_site_option_caches(array $options) + { + } + /** + * Primes specific network options into the cache with a single database query. + * + * Only network options that do not already exist in cache will be loaded. + * + * If site is not multisite, then call wp_prime_option_caches(). + * + * @since 6.6.0 + * + * @global wpdb $wpdb WordPress database abstraction object. + * + * @param int $network_id ID of the network. Can be null to default to the current network ID. + * @param string[] $options An array of option names to be loaded. + * @phpstan-return void + */ + function wp_prime_network_option_caches($network_id, array $options) + { + } /** * Loads and primes caches of certain often requested network options if is_multisite(). * * @since 3.0.0 * @since 6.3.0 Also prime caches for network options when persistent object cache is enabled. - * - * @global wpdb $wpdb WordPress database abstraction object. + * @since 6.6.0 Uses wp_prime_network_option_caches(). * * @param int $network_id Optional. Network ID of network for which to prime network options cache. Defaults to current network. * @phpstan-return void @@ -127036,17 +129345,21 @@ function wp_load_core_site_options($network_id = \null) * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $option Name of the option to update. Expected to not be SQL-escaped. - * @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. - * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. For existing options, - * `$autoload` can only be updated using `update_option()` if `$value` is also changed. - * Accepts 'yes'|true to enable or 'no'|false to disable. - * Autoloading too many options can lead to performance problems, especially if the - * options are not frequently used. For options which are accessed across several places - * in the frontend, it is recommended to autoload them, by using 'yes'|true. - * For options which are accessed only on few specific URLs, it is recommended - * to not autoload them, by using 'no'|false. For non-existent options, the default value - * is 'yes'. Default null. + * @param string $option Name of the option to update. Expected to not be SQL-escaped. + * @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. + * @param bool|null $autoload Optional. Whether to load the option when WordPress starts up. + * Accepts a boolean, or `null` to stick with the initial value or, if no initial value is set, + * to leave the decision up to default heuristics in WordPress. + * For existing options, + * `$autoload` can only be updated using `update_option()` if `$value` is also changed. + * For backward compatibility 'yes' and 'no' are also accepted. + * Autoloading too many options can lead to performance problems, especially if the + * options are not frequently used. For options which are accessed across several places + * in the frontend, it is recommended to autoload them, by using true. + * For options which are accessed only on few specific URLs, it is recommended + * to not autoload them, by using false. + * For non-existent options, the default is null, which means WordPress will determine + * the autoload value. * @return bool True if the value was updated, false otherwise. */ function update_option($option, $value, $autoload = \null) @@ -127065,23 +129378,26 @@ function update_option($option, $value, $autoload = \null) * options the same as the ones which are protected. * * @since 1.0.0 + * @since 6.6.0 The $autoload parameter's default value was changed to null. * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $option Name of the option to add. Expected to not be SQL-escaped. - * @param mixed $value Optional. Option value. Must be serializable if non-scalar. - * Expected to not be SQL-escaped. - * @param string $deprecated Optional. Description. Not used anymore. - * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. - * Accepts 'yes'|true to enable or 'no'|false to disable. - * Autoloading too many options can lead to performance problems, especially if the - * options are not frequently used. For options which are accessed across several places - * in the frontend, it is recommended to autoload them, by using 'yes'|true. - * For options which are accessed only on few specific URLs, it is recommended - * to not autoload them, by using 'no'|false. Default 'yes'. + * @param string $option Name of the option to add. Expected to not be SQL-escaped. + * @param mixed $value Optional. Option value. Must be serializable if non-scalar. + * Expected to not be SQL-escaped. + * @param string $deprecated Optional. Description. Not used anymore. + * @param bool|null $autoload Optional. Whether to load the option when WordPress starts up. + * Accepts a boolean, or `null` to leave the decision up to default heuristics in WordPress. + * For backward compatibility 'yes' and 'no' are also accepted. + * Autoloading too many options can lead to performance problems, especially if the + * options are not frequently used. For options which are accessed across several places + * in the frontend, it is recommended to autoload them, by using 'yes'|true. + * For options which are accessed only on few specific URLs, it is recommended + * to not autoload them, by using false. + * Default is null, which means WordPress will determine the autoload value. * @return bool True if the option was added, false otherwise. */ - function add_option($option, $value = '', $deprecated = '', $autoload = 'yes') + function add_option($option, $value = '', $deprecated = '', $autoload = \null) { } /** @@ -127097,6 +129413,49 @@ function add_option($option, $value = '', $deprecated = '', $autoload = 'yes') function delete_option($option) { } + /** + * Determines the appropriate autoload value for an option based on input. + * + * This function checks the provided autoload value and returns a standardized value + * ('on', 'off', 'auto-on', 'auto-off', or 'auto') based on specific conditions. + * + * If no explicit autoload value is provided, the function will check for certain heuristics around the given option. + * It will return `auto-on` to indicate autoloading, `auto-off` to indicate not autoloading, or `auto` if no clear + * decision could be made. + * + * @since 6.6.0 + * @access private + * + * @param string $option The name of the option. + * @param mixed $value The value of the option to check its autoload value. + * @param mixed $serialized_value The serialized value of the option to check its autoload value. + * @param bool|null $autoload The autoload value to check. + * Accepts 'on'|true to enable or 'off'|false to disable, or + * 'auto-on', 'auto-off', or 'auto' for internal purposes. + * Any other autoload value will be forced to either 'auto-on', + * 'auto-off', or 'auto'. + * 'yes' and 'no' are supported for backward compatibility. + * @return string Returns the original $autoload value if explicit, or 'auto-on', 'auto-off', + * or 'auto' depending on default heuristics. + */ + function wp_determine_option_autoload_value($option, $value, $serialized_value, $autoload) + { + } + /** + * Filters the default autoload value to disable autoloading if the option value is too large. + * + * @since 6.6.0 + * @access private + * + * @param bool|null $autoload The default autoload value to set. + * @param string $option The passed option name. + * @param mixed $value The passed option value to be saved. + * @param mixed $serialized_value The passed option value to be saved, in serialized form. + * @return bool|null Potentially modified $default. + */ + function wp_filter_default_autoload_value_via_option_size($autoload, $option, $value, $serialized_value) + { + } /** * Deletes a transient. * @@ -127451,6 +129810,7 @@ function register_initial_settings() * @since 4.7.0 `$args` can be passed to set flags on the setting, similar to `register_meta()`. * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`. * Please consider writing more inclusive code. + * @since 6.6.0 Added the `label` argument. * * @global array $new_allowed_options * @global array $wp_registered_settings @@ -127464,6 +129824,7 @@ function register_initial_settings() * * @type string $type The type of data associated with this setting. * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. + * @type string $label A label of the data attached to this setting. * @type string $description A description of the data attached to this setting. * @type callable $sanitize_callback A callback function that sanitizes the option's value. * @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API. @@ -127473,6 +129834,7 @@ function register_initial_settings() * } * @phpstan-param array{ * type?: string, + * label?: string, * description?: string, * sanitize_callback?: callable, * show_in_rest?: bool|array, @@ -127528,6 +129890,16 @@ function get_registered_settings() function filter_default_option($default_value, $option, $passed_default) { } + /** + * Returns the values that trigger autoloading from the options table. + * + * @since 6.6.0 + * + * @return string[] The values that trigger autoloading. + */ + function wp_autoload_values_to_autoload() + { + } /** * Changes the current user by ID or name. * @@ -129093,8 +131465,8 @@ function has_post_format($format = array(), $post = \null) * * @since 3.1.0 * - * @param int|object $post The post for which to assign a format. - * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. + * @param int|WP_Post $post The post for which to assign a format. + * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. * @return array|WP_Error|false Array of affected term IDs on success. WP_Error on error. */ function set_post_format($post, $format) @@ -129918,8 +132290,8 @@ function get_page_template_slug($post = \null) * * @since 2.6.0 * - * @param int|object $revision Revision ID or revision object. - * @param bool $link Optional. Whether to link to revision's page. Default true. + * @param int|WP_Post $revision Revision ID or revision object. + * @param bool $link Optional. Whether to link to revision's page. Default true. * @return string|false i18n formatted datetimestamp or localized 'Current Revision'. */ function wp_post_revision_title($revision, $link = \true) @@ -129930,8 +132302,8 @@ function wp_post_revision_title($revision, $link = \true) * * @since 3.6.0 * - * @param int|object $revision Revision ID or revision object. - * @param bool $link Optional. Whether to link to revision's page. Default true. + * @param int|WP_Post $revision Revision ID or revision object. + * @param bool $link Optional. Whether to link to revision's page. Default true. * @return string|false gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'. */ function wp_post_revision_title_expanded($revision, $link = \true) @@ -130679,8 +133051,10 @@ function get_post_types($args = array(), $output = 'names', $operator = 'and') * 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', * 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'. * Additionally, the 'revisions' feature dictates whether the post type - * will store revisions, and the 'comments' feature dictates whether the - * comments count will show on the edit screen. A feature can also be + * will store revisions, the 'autosave' feature dictates whether the post type + * will be autosaved, and the 'comments' feature dictates whether the + * comments count will show on the edit screen. For backward compatibility reasons, + * adding 'editor' support implies 'autosave' support too. A feature can also be * specified as an array of arguments to provide additional information * about supporting that feature. * Example: `array( 'my_feature', array( 'field' => 'value' ) )`. @@ -130943,6 +133317,7 @@ function _post_type_meta_capabilities($capabilities = \null) * @since 6.3.0 Added the `item_trashed` label. * @since 6.4.0 Changed default values for the `add_new` label to include the type of content. * This matches `add_new_item` and provides more context for better accessibility. + * @since 6.6.0 Added the `template_name` label. * * @access private * @@ -130984,7 +133359,8 @@ function _add_post_type_submenus() * 'thumbnail', 'custom-fields', and 'post-formats'. * * Additionally, the 'revisions' feature dictates whether the post type will - * store revisions, and the 'comments' feature dictates whether the comments + * store revisions, the 'autosave' feature dictates whether the post type + * will be autosaved, and the 'comments' feature dictates whether the comments * count will show on the edit screen. * * A third, optional parameter can also be passed along with a feature to provide @@ -131630,12 +134006,12 @@ function wp_post_mime_type_where($post_mime_types, $table_alias = '') * @see wp_delete_attachment() * @see wp_trash_post() * - * @param int $postid Optional. Post ID. Default 0. + * @param int $post_id Optional. Post ID. Default 0. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. * Default false. * @return WP_Post|false|null Post data on success, false or null on failure. */ - function wp_delete_post($postid = 0, $force_delete = \false) + function wp_delete_post($post_id = 0, $force_delete = \false) { } /** @@ -133082,10 +135458,10 @@ function _prime_post_caches($ids, $update_term_cache = \true, $update_meta_cache /** * Prime the cache containing the parent ID of various post objects. * - * @global wpdb $wpdb WordPress database abstraction object. - * * @since 6.4.0 * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int[] $ids ID list. * @phpstan-return void */ @@ -134516,7 +136892,7 @@ function rest_get_avatar_sizes() * @param string $date RFC3339 timestamp. * @param bool $force_utc Optional. Whether to force UTC timezone instead of using * the timestamp's timezone. Default false. - * @return int Unix timestamp. + * @return int|false Unix timestamp on success, false on failure. */ function rest_parse_date($date, $force_utc = \false) { @@ -134527,7 +136903,7 @@ function rest_parse_date($date, $force_utc = \false) * @since 5.4.0 * * @param string $color 3 or 6 digit hex color (with #). - * @return string|false + * @return string|false Color value on success, false on failure. */ function rest_parse_hex_color($color) { @@ -136627,10 +139003,10 @@ function wp_remove_surrounding_empty_script_tags($contents) * This function provides access to the WP_Script_Modules instance, creating one * if it doesn't exist yet. * - * @global WP_Script_Modules $wp_script_modules - * * @since 6.5.0 * + * @global WP_Script_Modules $wp_script_modules + * * @return WP_Script_Modules The main WP_Script_Modules instance. */ function wp_script_modules() : \WP_Script_Modules @@ -136642,30 +139018,30 @@ function wp_script_modules() : \WP_Script_Modules * * @since 6.5.0 * - * @param string $id The identifier of the script module. Should be unique. It will be used in the - * final import map. - * @param string $src Optional. Full URL of the script module, or path of the script module relative - * to the WordPress root directory. If it is provided and the script module has - * not been registered yet, it will be registered. - * @param array $deps { - * Optional. List of dependencies. - * - * @type string|array ...$0 { - * An array of script module identifiers of the dependencies of this script - * module. The dependencies can be strings or arrays. If they are arrays, - * they need an `id` key with the script module identifier, and can contain - * an `import` key with either `static` or `dynamic`. By default, - * dependencies that don't contain an `import` key are considered static. - * - * @type string $id The script module identifier. - * @type string $import Optional. Import type. May be either `static` or - * `dynamic`. Defaults to `static`. - * } - * } - * @param string|false|null $version Optional. String specifying the script module version number. Defaults to false. - * It is added to the URL as a query string for cache busting purposes. If $version - * is set to false, the version number is the currently installed WordPress version. - * If $version is set to null, no version is added. + * @param string $id The identifier of the script module. Should be unique. It will be used in the + * final import map. + * @param string $src Optional. Full URL of the script module, or path of the script module relative + * to the WordPress root directory. If it is provided and the script module has + * not been registered yet, it will be registered. + * @param array $deps { + * Optional. List of dependencies. + * + * @type string|array ...$0 { + * An array of script module identifiers of the dependencies of this script + * module. The dependencies can be strings or arrays. If they are arrays, + * they need an `id` key with the script module identifier, and can contain + * an `import` key with either `static` or `dynamic`. By default, + * dependencies that don't contain an `import` key are considered static. + * + * @type string $id The script module identifier. + * @type string $import Optional. Import type. May be either `static` or + * `dynamic`. Defaults to `static`. + * } + * } + * @param string|false|null $version Optional. String specifying the script module version number. Defaults to false. + * It is added to the URL as a query string for cache busting purposes. If $version + * is set to false, the version number is the currently installed WordPress version. + * If $version is set to null, no version is added. * @phpstan-param array "$value", "$property" => "$value" )`. @@ -137225,6 +139604,7 @@ function wp_style_engine_get_styles($block_styles, $options = array()) * } * @return string A string of compiled CSS declarations, or empty string. * @phpstan-param array $css_rules @@ -137567,6 +139947,7 @@ function unregister_taxonomy($taxonomy) * @since 5.8.0 Added the `item_link` and `item_link_description` labels. * @since 5.9.0 Added the `name_field_description`, `slug_field_description`, * `parent_field_description`, and `desc_field_description` labels. + * @since 6.6.0 Added the `template_name` label. * * @param WP_Taxonomy $tax Taxonomy object. * @return object { @@ -137601,6 +139982,7 @@ function unregister_taxonomy($taxonomy) * @type string $update_item Default 'Update Tag'/'Update Category'. * @type string $add_new_item Default 'Add New Tag'/'Add New Category'. * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. + * @type string $template_name Default 'Tag Archives'/'Category Archives'. * @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default * 'Separate tags with commas', used in the meta box. * @type string $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default @@ -137640,6 +140022,7 @@ function unregister_taxonomy($taxonomy) * update_item: string, * add_new_item: string, * new_item_name: string, + * template_name: string, * separate_items_with_commas: string, * add_or_remove_items: string, * choose_from_most_used: string, @@ -140602,6 +142985,7 @@ function get_theme_starter_content() * @since 6.3.0 The `border` feature allows themes without theme.json to add border styles to blocks. * @since 6.5.0 The `appearance-tools` feature enables a few design tools for blocks, * see `WP_Theme_JSON::APPEARANCE_TOOLS_OPT_INS` for a complete list. + * @since 6.6.0 The `editor-spacing-sizes` feature was added. * * @global array $_wp_theme_features * @@ -140629,6 +143013,7 @@ function get_theme_starter_content() * - 'editor-color-palette' * - 'editor-gradient-presets' * - 'editor-font-sizes' + * - 'editor-spacing-sizes' * - 'editor-styles' * - 'featured-content' * - 'html5' @@ -140850,6 +143235,7 @@ function get_registered_theme_feature($feature) * @since 3.0.0 * @since 4.3.0 Also removes `header_image_data`. * @since 4.5.0 Also removes custom logo theme mods. + * @since 6.6.0 Also removes `site_logo` option set by the site logo block. * * @param int $id The attachment ID. */ @@ -141246,6 +143632,7 @@ function _wp_delete_all_temp_backups() * @since 2.5.0 * * @global string $auth_secure_cookie + * @global wpdb $wpdb WordPress database abstraction object. * * @param array $credentials { * Optional. User info in order to sign on. @@ -141814,54 +144201,70 @@ function setup_userdata($for_user_id = 0) * * @since 2.3.0 * @since 4.5.0 Added the 'display_name_with_login' value for 'show'. - * @since 4.7.0 Added the `$role`, `$role__in`, and `$role__not_in` parameters. + * @since 4.7.0 Added the 'role', 'role__in', and 'role__not_in' parameters. + * @since 5.9.0 Added the 'capability', 'capability__in', and 'capability__not_in' parameters. + * Deprecated the 'who' parameter. * * @param array|string $args { * Optional. Array or string of arguments to generate a drop-down of users. * See WP_User_Query::prepare_query() for additional available arguments. * - * @type string $show_option_all Text to show as the drop-down default (all). - * Default empty. - * @type string $show_option_none Text to show as the drop-down default when no - * users were found. Default empty. - * @type int|string $option_none_value Value to use for $show_option_none when no users - * were found. Default -1. - * @type string $hide_if_only_one_author Whether to skip generating the drop-down - * if only one user was found. Default empty. - * @type string $orderby Field to order found users by. Accepts user fields. - * Default 'display_name'. - * @type string $order Whether to order users in ascending or descending - * order. Accepts 'ASC' (ascending) or 'DESC' (descending). - * Default 'ASC'. - * @type int[]|string $include Array or comma-separated list of user IDs to include. - * Default empty. - * @type int[]|string $exclude Array or comma-separated list of user IDs to exclude. - * Default empty. - * @type bool|int $multi Whether to skip the ID attribute on the 'select' element. - * Accepts 1|true or 0|false. Default 0|false. - * @type string $show User data to display. If the selected item is empty - * then the 'user_login' will be displayed in parentheses. - * Accepts any user field, or 'display_name_with_login' to show - * the display name with user_login in parentheses. - * Default 'display_name'. - * @type int|bool $echo Whether to echo or return the drop-down. Accepts 1|true (echo) - * or 0|false (return). Default 1|true. - * @type int $selected Which user ID should be selected. Default 0. - * @type bool $include_selected Whether to always include the selected user ID in the drop- - * down. Default false. - * @type string $name Name attribute of select element. Default 'user'. - * @type string $id ID attribute of the select element. Default is the value of $name. - * @type string $class Class attribute of the select element. Default empty. - * @type int $blog_id ID of blog (Multisite only). Default is ID of the current blog. - * @type string $who Which type of users to query. Accepts only an empty string or - * 'authors'. Default empty. - * @type string|array $role An array or a comma-separated list of role names that users must - * match to be included in results. Note that this is an inclusive - * list: users must match *each* role. Default empty. - * @type string[] $role__in An array of role names. Matched users must have at least one of - * these roles. Default empty array. - * @type string[] $role__not_in An array of role names to exclude. Users matching one or more of - * these roles will not be included in results. Default empty array. + * @type string $show_option_all Text to show as the drop-down default (all). + * Default empty. + * @type string $show_option_none Text to show as the drop-down default when no + * users were found. Default empty. + * @type int|string $option_none_value Value to use for `$show_option_none` when no users + * were found. Default -1. + * @type string $hide_if_only_one_author Whether to skip generating the drop-down + * if only one user was found. Default empty. + * @type string $orderby Field to order found users by. Accepts user fields. + * Default 'display_name'. + * @type string $order Whether to order users in ascending or descending + * order. Accepts 'ASC' (ascending) or 'DESC' (descending). + * Default 'ASC'. + * @type int[]|string $include Array or comma-separated list of user IDs to include. + * Default empty. + * @type int[]|string $exclude Array or comma-separated list of user IDs to exclude. + * Default empty. + * @type bool|int $multi Whether to skip the ID attribute on the 'select' element. + * Accepts 1|true or 0|false. Default 0|false. + * @type string $show User data to display. If the selected item is empty + * then the 'user_login' will be displayed in parentheses. + * Accepts any user field, or 'display_name_with_login' to show + * the display name with user_login in parentheses. + * Default 'display_name'. + * @type int|bool $echo Whether to echo or return the drop-down. Accepts 1|true (echo) + * or 0|false (return). Default 1|true. + * @type int $selected Which user ID should be selected. Default 0. + * @type bool $include_selected Whether to always include the selected user ID in the drop- + * down. Default false. + * @type string $name Name attribute of select element. Default 'user'. + * @type string $id ID attribute of the select element. Default is the value of `$name`. + * @type string $class Class attribute of the select element. Default empty. + * @type int $blog_id ID of blog (Multisite only). Default is ID of the current blog. + * @type string $who Deprecated, use `$capability` instead. + * Which type of users to query. Accepts only an empty string or + * 'authors'. Default empty (all users). + * @type string|string[] $role An array or a comma-separated list of role names that users + * must match to be included in results. Note that this is + * an inclusive list: users must match *each* role. Default empty. + * @type string[] $role__in An array of role names. Matched users must have at least one + * of these roles. Default empty array. + * @type string[] $role__not_in An array of role names to exclude. Users matching one or more + * of these roles will not be included in results. Default empty array. + * @type string|string[] $capability An array or a comma-separated list of capability names that users + * must match to be included in results. Note that this is + * an inclusive list: users must match *each* capability. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty. + * @type string[] $capability__in An array of capability names. Matched users must have at least one + * of these capabilities. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty array. + * @type string[] $capability__not_in An array of capability names to exclude. Users matching one or more + * of these capabilities will not be included in results. + * Does NOT work for capabilities not in the database or filtered + * via {@see 'map_meta_cap'}. Default empty array. * } * @return string HTML dropdown list of users. * @phpstan-param array{ @@ -141883,9 +144286,12 @@ function setup_userdata($for_user_id = 0) * class?: string, * blog_id?: int, * who?: string, - * role?: string|array, + * role?: string|string[], * role__in?: string[], * role__not_in?: string[], + * capability?: string|string[], + * capability__in?: string[], + * capability__not_in?: string[], * blog_id?: int, * role?: string|string[], * role__in?: string[], @@ -143449,12 +145855,12 @@ function _wp_block_theme_register_classic_sidebars() * upon successful login. * @global string $action The action that brought the visitor to the login page. * - * @param string $title Optional. WordPress login Page title to display in the `` element. - * Default 'Log In'. - * @param string $message Optional. Message to display in header. Default empty. - * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance. + * @param string|null $title Optional. WordPress login page title to display in the `<title>` element. + * Defaults to 'Log In'. + * @param string $message Optional. Message to display in header. Default empty. + * @param WP_Error|null $wp_error Optional. The error to pass. Defaults to a WP_Error instance. */ - function login_header($title = 'Log In', $message = '', $wp_error = \null) + function login_header($title = \null, $message = '', $wp_error = \null) { } // End of login_header().