diff --git a/functionMap.php b/functionMap.php index b051271..a283757 100644 --- a/functionMap.php +++ b/functionMap.php @@ -10,7 +10,7 @@ $cronArgsType = 'list'; $wpWidgetRssFormArgsType = 'array{number: int, error: bool, title?: string, url?: string, items?: int, show_summary?: int, show_author?: int, show_date?: int}'; $wpWidgetRssFormInputsType = 'array{title?: bool, url?: bool, items?: bool, show_summary?: bool, show_author?: bool, show_date?: bool}'; -$filesystemDirlistReturnType = "false|array"; +$filesystemDirlistReturnType = "false|array"; /** * This array is in the same format as the function map array in PHPStan: @@ -41,8 +41,6 @@ 'WP_Http::head' => [$httpReturnType], 'WP_Http::post' => [$httpReturnType], 'WP_Http::request' => [$httpReturnType], - 'WP_List_Table::display_tablenav' => ['void', 'which' => '"top"|"bottom"'], - 'WP_List_Table::pagination' => ['void', 'which' => '"top"|"bottom"'], 'WP_List_Table::set_pagination_args' => ['void', 'args' => 'array{total_items?: int, total_pages?: int, per_page?: int}'], 'wp_next_scheduled' => [null, 'args' => $cronArgsType], 'WP_Query::have_posts' => [null, '@phpstan-impure' => ''], diff --git a/source/composer.json b/source/composer.json index 4f7f16e..ba91333 100644 --- a/source/composer.json +++ b/source/composer.json @@ -7,7 +7,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "johnpbloch/wordpress": "6.4.3" + "johnpbloch/wordpress": "6.5.0" }, "minimum-stability": "stable", "config": { diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 6a936c7..e9d1899 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -954,8 +954,11 @@ class Custom_Background * Constructor - Registers administration header callback. * * @since 3.0.0 - * @param callable $admin_header_callback - * @param callable $admin_image_div_callback Optional custom image div output callback. + * + * @param callable $admin_header_callback Optional. Administration header callback. + * Default empty string. + * @param callable $admin_image_div_callback Optional. Custom image div output callback. + * Default empty string. */ public function __construct($admin_header_callback = '', $admin_image_div_callback = '') { @@ -1080,11 +1083,13 @@ class Custom_Image_Header */ public $default_headers = array(); /** - * Constructor - Register administration header callback. + * Constructor - Registers administration header callback. * * @since 2.1.0 - * @param callable $admin_header_callback - * @param callable $admin_image_div_callback Optional custom image div output callback. + * + * @param callable $admin_header_callback Administration header callback. + * @param callable $admin_image_div_callback Optional. Custom image div output callback. + * Default empty string. */ public function __construct($admin_header_callback, $admin_image_div_callback = '') { @@ -1313,6 +1318,7 @@ public final function get_header_dimensions($dimensions) * Creates an attachment 'object'. * * @since 3.9.0 + * @deprecated 6.5.0 * * @param string $cropped Cropped image URL. * @param int $parent_attachment_id Attachment ID of parent image. @@ -3368,6 +3374,8 @@ public function upgrade($theme, $args = array()) * @since 3.0.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * + * @global string $wp_version The WordPress version string. + * * @param string[] $themes Array of the theme slugs. * @param array $args { * Optional. Other arguments for upgrading several themes at once. Default empty array. @@ -4460,7 +4468,7 @@ protected function get_bulk_actions() * * @since 3.1.0 * - * @param string $which The location of the bulk actions: 'top' or 'bottom'. + * @param string $which The location of the bulk actions: Either 'top' or 'bottom'. * This is designated as optional for backward compatibility. * @phpstan-param 'top'|'bottom' $which * @phpstan-return void @@ -4552,8 +4560,8 @@ protected function get_items_per_page($option, $default_value = 20) * * @since 3.1.0 * - * @param string $which - * @phpstan-param "top"|"bottom" $which + * @param string $which The location of the pagination: Either 'top' or 'bottom'. + * @phpstan-param 'top'|'bottom' $which * @phpstan-return void */ protected function pagination($which) @@ -4692,9 +4700,8 @@ protected function get_table_classes() * Generates the table navigation above or below the table * * @since 3.1.0 - * @param string $which - * @phpstan-param "top"|"bottom" $which - * @phpstan-return void + * @param string $which The location of the navigation: Either 'top' or 'bottom'. + * @phpstan-param 'top'|'bottom' $which */ protected function display_tablenav($which) { @@ -4892,7 +4899,7 @@ protected function column_default($item, $column_name) * * @since 5.6.0 * - * @param string $which The location of the bulk actions: 'top' or 'bottom'. + * @param string $which The location of the bulk actions: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function display_tablenav($which) @@ -6214,7 +6221,7 @@ public function rmdir($path, $recursive = \false) * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * - * @type array $0... { + * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. @@ -6235,23 +6242,21 @@ public function rmdir($path, $recursive = \false) * files. False if unable to list directory contents. * } * } - * @phpstan-return false|array{ - * 0...: array{ - * name: string, - * perms: string, - * permsn: string, - * number: int|string|false, - * owner: string|false, - * group: string|false, - * size: int|string|false, - * lastmodunix: int|string|false, - * lastmod: string|false, - * time: string|false, - * type: string, - * files: array|false, - * }, - * } - * @phpstan-return false|array + * @phpstan-return false|array + * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { @@ -6617,7 +6622,7 @@ public function rmdir($path, $recursive = \false) * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * - * @type array $0... { + * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. @@ -6638,23 +6643,21 @@ public function rmdir($path, $recursive = \false) * files. False if unable to list directory contents. * } * } - * @phpstan-return false|array{ - * 0...: array{ - * name: string, - * perms: string, - * permsn: string, - * number: false, - * owner: string|false, - * group: string|false, - * size: int|string|false, - * lastmodunix: int|string|false, - * lastmod: string|false, - * time: string|false, - * type: string, - * files: array|false, - * }, - * } - * @phpstan-return false|array + * @phpstan-return false|array + * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { @@ -7046,7 +7049,7 @@ public function parselisting($line) * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * - * @type array $0... { + * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. @@ -7067,23 +7070,21 @@ public function parselisting($line) * files. False if unable to list directory contents. * } * } - * @phpstan-return false|array{ - * 0...: array{ - * name: string, - * perms: string, - * permsn: string, - * number: int|string|false, - * owner: string|false, - * group: string|false, - * size: int|string|false, - * lastmodunix: int|string|false, - * lastmod: string|false, - * time: string|false, - * type: string, - * files: array|false, - * }, - * } - * @phpstan-return false|array + * @phpstan-return false|array + * @phpstan-return false|array */ public function dirlist($path = '.', $include_hidden = \true, $recursive = \false) { @@ -7445,7 +7446,7 @@ public function rmdir($path, $recursive = \false) * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * - * @type array $0... { + * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. @@ -7466,23 +7467,21 @@ public function rmdir($path, $recursive = \false) * files. False if unable to list directory contents. * } * } - * @phpstan-return false|array{ - * 0...: array{ - * name: string, - * perms: string, - * permsn: string, - * number: int|string|false, - * owner: string|false, - * group: string|false, - * size: int|string|false, - * lastmodunix: int|string|false, - * lastmod: string|false, - * time: string|false, - * type: string, - * files: array|false, - * }, - * } - * @phpstan-return false|array + * @phpstan-return false|array + * @phpstan-return false|array */ public function dirlist($path = '.', $include_hidden = \true, $recursive = \false) { @@ -7501,9 +7500,9 @@ public function __destruct() * * To use this class you must follow these steps for PHP 5.2.6+ * - * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes + * {@link http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes} * - * Compile libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work) + * Compile libssh2 (Note: Only 0.14 is officially working with PHP 5.2.6+ right now, But many users have found the latest versions work) * * cd /usr/src * wget https://www.libssh2.org/download/libssh2-0.14.tar.gz @@ -7928,7 +7927,7 @@ public function rmdir($path, $recursive = \false) * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * - * @type array $0... { + * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. @@ -7949,23 +7948,21 @@ public function rmdir($path, $recursive = \false) * files. False if unable to list directory contents. * } * } - * @phpstan-return false|array{ - * 0...: array{ - * name: string, - * perms: string, - * permsn: string, - * number: false, - * owner: string|false, - * group: string|false, - * size: int|string|false, - * lastmodunix: int|string|false, - * lastmod: string|false, - * time: string|false, - * type: string, - * files: array|false, - * }, - * } - * @phpstan-return false|array + * @phpstan-return false|array + * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { @@ -8715,7 +8712,7 @@ protected function get_bulk_actions() /** * @global string $mode List table view mode. * - * @param string $which The location of the pagination nav markup: 'top' or 'bottom'. + * @param string $which The location of the pagination nav markup: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function pagination($which) @@ -8726,7 +8723,7 @@ protected function pagination($which) * * @since 5.3.0 * - * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. + * @param string $which The location of the extra table nav markup: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function extra_tablenav($which) @@ -9401,6 +9398,70 @@ public function get_columns() public function display_rows() { } + /** + * Returns a notice containing a list of dependencies required by the plugin. + * + * @since 6.5.0 + * + * @param array $plugin_data An array of plugin data. See {@see plugins_api()} + * for the list of possible values. + * @return string A notice containing a list of dependencies required by the plugin, + * or an empty string if none is required. + * @phpstan-param object|array{ + * slug?: string, + * per_page?: int, + * page?: int, + * number?: int, + * search?: string, + * tag?: string, + * author?: string, + * user?: string, + * browse?: string, + * locale?: string, + * installed_plugins?: string, + * is_ssl?: bool, + * fields?: array{ + * short_description?: bool, + * description?: bool, + * sections?: bool, + * tested?: bool, + * requires?: bool, + * requires_php?: bool, + * rating?: bool, + * ratings?: bool, + * downloaded?: bool, + * downloadlink?: bool, + * last_updated?: bool, + * added?: bool, + * tags?: bool, + * compatibility?: bool, + * homepage?: bool, + * versions?: bool, + * donate_link?: bool, + * reviews?: bool, + * banners?: bool, + * icons?: bool, + * active_installs?: bool, + * group?: bool, + * contributors?: bool, + * }, + * } $plugin_data See plugins_api() + */ + protected function get_dependencies_notice($plugin_data) + { + } + /** + * Creates a 'More details' link for the plugin. + * + * @since 6.5.0 + * + * @param string $name The plugin's name. + * @param string $slug The plugin's slug. + * @return string The 'More details' link for the plugin. + */ + protected function get_more_details_link($name, $slug) + { + } } /** * List Table API: WP_Plugins_List_Table class @@ -9581,6 +9642,52 @@ public function single_row($item) protected function get_primary_column_name() { } + /** + * Prints a list of other plugins that depend on the plugin. + * + * @since 6.5.0 + * + * @param string $dependency The dependency's filepath, relative to the plugins directory. + * @phpstan-return void + */ + protected function add_dependents_to_dependency_plugin_row($dependency) + { + } + /** + * Prints a list of other plugins that the plugin depends on. + * + * @since 6.5.0 + * + * @param string $dependent The dependent plugin's filepath, relative to the plugins directory. + * @phpstan-return void + */ + protected function add_dependencies_to_dependent_plugin_row($dependent) + { + } + /** + * Returns a 'View details' like link for a dependency. + * + * @since 6.5.0 + * + * @param string $name The dependency's name. + * @param string $slug The dependency's slug. + * @return string A 'View details' link for the dependency. + */ + protected function get_dependency_view_details_link($name, $slug) + { + } + /** + * Returns a 'View details' link for the plugin. + * + * @since 6.5.0 + * + * @param string $name The plugin's name. + * @param string $slug The plugin's slug. + * @return string A 'View details' link for the plugin. + */ + protected function get_view_details_link($name, $slug) + { + } } /** * List Table API: WP_Post_Comments_List_Table class @@ -11162,8 +11269,6 @@ public function get_test_sql_server() * * @since 5.2.0 * - * @global wpdb $wpdb WordPress database abstraction object. - * * @return array The test results. */ public function get_test_utf8mb4_support() @@ -11564,6 +11669,7 @@ public function __construct() * Creates an attachment 'object'. * * @since 4.3.0 + * @deprecated 6.5.0 * * @param string $cropped Cropped image URL. * @param int $parent_attachment_id Attachment ID of parent image. @@ -12125,7 +12231,7 @@ public function no_items() * with this table. * * Provides a list of roles and user count for that role for easy - * Filtersing of the user table. + * filtering of the user table. * * @since 3.1.0 * @@ -12558,6 +12664,17 @@ public static function CastAsInt($floatnum) public static function intValueSupported($num) { } + /** + * Perform a division, guarding against division by zero + * + * @param float|int $numerator + * @param float|int $denominator + * @param float|int $fallback + * @return float|int + */ + public static function SafeDiv($numerator, $denominator, $fallback = 0) + { + } /** * @param string $fraction * @@ -13438,7 +13555,7 @@ class getID3 * @var string */ protected $startup_warning = ''; - const VERSION = '1.9.22-202207161647'; + const VERSION = '1.9.23-202310190849'; const FREAD_BUFFER_SIZE = 32768; const ATTACHMENTS_NONE = \false; const ATTACHMENTS_INLINE = \true; @@ -13678,6 +13795,8 @@ public function setStringMode($string) { } /** + * @phpstan-impure + * * @return int|bool */ protected function ftell() @@ -13686,6 +13805,8 @@ protected function ftell() /** * @param int $bytes * + * @phpstan-impure + * * @return string|false * * @throws getid3_exception @@ -13697,6 +13818,8 @@ protected function fread($bytes) * @param int $bytes * @param int $whence * + * @phpstan-impure + * * @return int * * @throws getid3_exception @@ -13705,6 +13828,8 @@ protected function fseek($bytes, $whence = \SEEK_SET) { } /** + * @phpstan-impure + * * @return string|false * * @throws getid3_exception @@ -13713,6 +13838,8 @@ protected function fgets() { } /** + * @phpstan-impure + * * @return bool */ protected function feof() @@ -16242,6 +16369,12 @@ class PHPMailer * @var string */ public $AuthType = ''; + /** + * SMTP SMTPXClient command attibutes + * + * @var array + */ + protected $SMTPXClient = []; /** * An implementation of the PHPMailer OAuthTokenProvider interface. * @@ -16593,7 +16726,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.8.1'; + const VERSION = '6.9.1'; /** * Error severity: message only, continue processing. * @@ -17016,6 +17149,25 @@ public function getSMTPInstance() public function setSMTPInstance(\PHPMailer\PHPMailer\SMTP $smtp) { } + /** + * Provide SMTP XCLIENT attributes + * + * @param string $name Attribute name + * @param ?string $value Attribute value + * + * @return bool + */ + public function setSMTPXclientAttribute($name, $value) + { + } + /** + * Get SMTP XCLIENT attributes + * + * @return array + */ + public function getSMTPXclientAttributes() + { + } /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. @@ -17545,6 +17697,33 @@ public function clearAttachments() public function clearCustomHeaders() { } + /** + * Clear a specific custom header by name or name and value. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + * + * @return bool True if a header was replaced successfully + */ + public function clearCustomHeader($name, $value = null) + { + } + /** + * Replace a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + * + * @return bool True if a header was replaced successfully + * @throws Exception + */ + public function replaceCustomHeader($name, $value = null) + { + } /** * Add an error message to the error container. * @@ -17972,7 +18151,7 @@ class SMTP * * @var string */ - const VERSION = '6.8.1'; + const VERSION = '6.9.1'; /** * SMTP line break constant. * @@ -18107,6 +18286,15 @@ class SMTP * @var string[] */ protected $smtp_transaction_id_patterns = ['exim' => '/[\\d]{3} OK id=(.*)/', 'sendmail' => '/[\\d]{3} 2.0.0 (.*) Message/', 'postfix' => '/[\\d]{3} 2.0.0 Ok: queued as (.*)/', 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\\d].0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\\d]{3} Ok (.*)/', 'SendGrid' => '/[\\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\\d]{3} 2.0.0 OK:([a-zA-Z\\d]{48})/', 'Haraka' => '/[\\d]{3} Message Queued \\((.*)\\)/', 'ZoneMTA' => '/[\\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\\d]{3} OK queued as (.*)/']; + /** + * Allowed SMTP XCLIENT attributes. + * Must be allowed by the SMTP server. EHLO response is not checked. + * + * @see https://www.postfix.org/XCLIENT_README.html + * + * @var array + */ + public static $xclient_allowed_attributes = ['NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT']; /** * The last transaction ID issued in response to a DATA command, * if one was detected. @@ -18338,6 +18526,14 @@ public function quit($close_on_error = true) public function recipient($address, $dsn = '') { } + /** + * Send SMTP XCLIENT command to server and check its return code. + * + * @return bool True on success + */ + public function xclient(array $vars) + { + } /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. @@ -23827,12 +24023,12 @@ public function set_cache_name_function($function = 'md5') { } /** - * Set options to make SP as fast as possible + * Set options to make SimplePie as fast as possible. * - * Forgoes a substantial amount of data sanitization in favor of speed. This - * turns SimplePie into a dumb parser of feeds. + * Forgoes a substantial amount of data sanitization in favor of speed. + * This turns SimplePie into a less clever parser of feeds. * - * @param bool $set Whether to set them or not + * @param bool $set Whether to set them or not. */ public function set_stupidly_fast($set = \false) { @@ -28778,7 +28974,7 @@ class Text_MappedDiff extends \Text_Diff /** * Computes a diff between sequences of strings. * - * This can be used to compute things like case-insensitve diffs, or diffs + * This can be used to compute things like case-insensitive diffs, or diffs * which ignore changes in white-space. * * @param array $from_lines An array of strings. @@ -29478,6 +29674,146 @@ function xml_escape($content) { } } + /** + * Server-side rendering of the `core/navigation` block. + * + * @package WordPress + */ + /** + * Helper functions used to render the navigation block. + */ + class WP_Navigation_Block_Renderer + { + /** + * Renders the navigation block. + * + * @param array $attributes The block attributes. + * @param string $content The saved content. + * @param WP_Block $block The parsed block. + * @return string Returns the navigation block markup. + */ + public static function render($attributes, $content, $block) + { + } + } +} +namespace Avifinfo { + //------------------------------------------------------------------------------ + // Features are parsed into temporary property associations. + class Tile + { + // Tile item id <-> parent item id associations. + public $tile_item_id; + public $parent_item_id; + } + class Prop + { + // Property index <-> item id associations. + public $property_index; + public $item_id; + } + class Dim_Prop + { + // Property <-> features associations. + public $property_index; + public $width; + public $height; + } + class Chan_Prop + { + // Property <-> features associations. + public $property_index; + public $bit_depth; + public $num_channels; + } + class Features + { + public $has_primary_item = false; + // True if "pitm" was parsed. + public $has_alpha = false; + // True if an alpha "auxC" was parsed. + public $primary_item_id; + public $primary_item_features = array( + // Deduced from the data below. + 'width' => UNDEFINED, + // In number of pixels. + 'height' => UNDEFINED, + // Ignores mirror and rotation. + 'bit_depth' => UNDEFINED, + // Likely 8, 10 or 12 bits per channel per pixel. + 'num_channels' => UNDEFINED, + ); + public $tiles = array(); + // Tile[] + public $props = array(); + // Prop[] + public $dim_props = array(); + // Dim_Prop[] + public $chan_props = array(); + /** + * Finds the width, height, bit depth and number of channels of the primary item. + * + * @return Status FOUND on success or NOT_FOUND on failure. + */ + public function get_primary_item_features() + { + } + } + //------------------------------------------------------------------------------ + class Box + { + public $size; + // In bytes. + public $type; + // Four characters. + public $version; + // 0 or actual version if this is a full box. + public $flags; + // 0 or actual value if this is a full box. + public $content_size; + // 'size' minus the header size. + /** + * Reads the box header. + * + * @param stream $handle The resource the header will be parsed from. + * @param int $num_parsed_boxes The total number of parsed boxes. Prevents timeouts. + * @param int $num_remaining_bytes The number of bytes that should be available from the resource. + * @return Status FOUND on success or an error on failure. + */ + public function parse($handle, &$num_parsed_boxes, $num_remaining_bytes = MAX_SIZE) + { + } + } + //------------------------------------------------------------------------------ + class Parser + { + public $features; + function __construct($handle) + { + } + /** + * Parses a file stream. + * + * The file type is checked through the "ftyp" box. + * + * @return bool True if the input stream is an AVIF bitstream or false. + */ + public function parse_ftyp() + { + } + /** + * Parses a file stream. + * + * Features are extracted from the "meta" box. + * + * @return bool True if the main features of the primary item were parsed or false. + */ + public function parse_file() + { + } + } +} +namespace { /** * Portable PHP password hashing framework. * @package phpass @@ -30397,6 +30733,7 @@ public function remove_menu($id) * * @since 3.1.0 * @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data. + * @since 6.5.0 Added the ability to pass 'menu_title' for an ARIA menu name. * * @param array $args { * Arguments for adding a node. @@ -30407,7 +30744,7 @@ public function remove_menu($id) * @type string $href Optional. Link for the item. * @type bool $group Optional. Whether or not the node is a group. Default false. * @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir', - * 'onclick', 'target', 'title', 'tabindex'. Default empty. + * 'onclick', 'target', 'title', 'tabindex', 'menu_title'. Default empty. * } * @phpstan-param array{ * id?: string, @@ -30541,11 +30878,13 @@ protected final function _render_container($node) } /** * @since 3.3.0 + * @since 6.5.0 Added `$menu_title` parameter to allow an ARIA menu name. * * @param object $node + * @param string|bool $menu_title The accessible name of this ARIA menu or false if not provided. * @phpstan-return void */ - protected final function _render_group($node) + protected final function _render_group($node, $menu_title = \false) { } /** @@ -30893,6 +31232,210 @@ public static function chunk_password($raw_password) { } } + /** + * Block Bindings API: WP_Block_Bindings_Registry class. + * + * Supports overriding content in blocks by connecting them to different sources. + * + * @package WordPress + * @subpackage Block Bindings + * @since 6.5.0 + */ + /** + * Core class used for interacting with block bindings sources. + * + * @since 6.5.0 + */ + final class WP_Block_Bindings_Registry + { + /** + * Registers a new block bindings source. + * + * This is a low-level method. For most use cases, it is recommended to use + * the `register_block_bindings_source()` function instead. + * + * @see register_block_bindings_source() + * + * Sources are used to override block's original attributes with a value + * coming from the source. Once a source is registered, it can be used by a + * block by setting its `metadata.bindings` attribute to a value that refers + * to the source. + * + * @since 6.5.0 + * + * @param string $source_name The name of the source. It must be a string containing a namespace prefix, i.e. + * `my-plugin/my-custom-source`. It must only contain lowercase alphanumeric + * characters, the forward slash `/` and dashes. + * @param array $source_properties { + * The array of arguments that are used to register a source. + * + * @type string $label The label of the source. + * @type 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. + * } + * @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, + * } $source_properties + */ + public function register(string $source_name, array $source_properties) + { + } + /** + * Unregisters a block bindings source. + * + * @since 6.5.0 + * + * @param string $source_name Block bindings source name including namespace. + * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise. + */ + public function unregister(string $source_name) + { + } + /** + * Retrieves the list of all registered block bindings sources. + * + * @since 6.5.0 + * + * @return WP_Block_Bindings_Source[] The array of registered sources. + */ + public function get_all_registered() + { + } + /** + * Retrieves a registered block bindings source. + * + * @since 6.5.0 + * + * @param string $source_name The name of the source. + * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered. + */ + public function get_registered(string $source_name) + { + } + /** + * Checks if a block bindings source is registered. + * + * @since 6.5.0 + * + * @param string $source_name The name of the source. + * @return bool `true` if the block bindings source is registered, `false` otherwise. + */ + public function is_registered($source_name) + { + } + /** + * Wakeup magic method. + * + * @since 6.5.0 + * @phpstan-return void + */ + public function __wakeup() + { + } + /** + * Utility method to retrieve the main instance of the class. + * + * The instance will be created if it does not exist yet. + * + * @since 6.5.0 + * + * @return WP_Block_Bindings_Registry The main instance. + */ + public static function get_instance() + { + } + } + /** + * Block Bindings API: WP_Block_Bindings_Source class. + * + * + * @package WordPress + * @subpackage Block Bindings + * @since 6.5.0 + */ + /** + * Class representing block bindings source. + * + * This class is designed for internal use by the Block Bindings registry. + * + * @since 6.5.0 + * @access private + * + * @see WP_Block_Bindings_Registry + */ + final class WP_Block_Bindings_Source + { + /** + * The name of the source. + * + * @since 6.5.0 + * @var string + */ + public $name; + /** + * The label of the source. + * + * @since 6.5.0 + * @var string + */ + public $label; + /** + * The context added to the blocks needed by the source. + * + * @since 6.5.0 + * @var array|null + */ + public $uses_context = \null; + /** + * Constructor. + * + * Do not use this constructor directly. Instead, use the + * `WP_Block_Bindings_Registry::register` method or the `register_block_bindings_source` function. + * + * @since 6.5.0 + * + * @param string $name The name of the source. + * @param array $source_properties The properties of the source. + */ + public function __construct(string $name, array $source_properties) + { + } + /** + * Retrieves the value from the source. + * + * @since 6.5.0 + * + * @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. + * + * @return mixed The value of the source. + */ + public function get_value(array $source_args, $block_instance, string $attribute_name) + { + } + /** + * Wakeup magic method. + * + * @since 6.5.0 + */ + public function __wakeup() + { + } + } /** * Blocks API: WP_Block_Editor_Context class * @@ -31535,13 +32078,16 @@ final class WP_Block_Patterns_Registry * @since 5.8.0 Added support for the `blockTypes` property. * @since 6.1.0 Added support for the `postTypes` property. * @since 6.2.0 Added support for the `templateTypes` property. + * @since 6.5.0 Added support for the `filePath` property. * * @param string $pattern_name Block pattern name including namespace. * @param array $pattern_properties { * List of properties for the block pattern. * * @type string $title Required. A human-readable title for the pattern. - * @type string $content Required. Block HTML markup for the pattern. + * @type string $content Optional. Block HTML markup for the pattern. + * If not provided, the content will be retrieved from the `filePath` if set. + * If both `content` and `filePath` are not set, the pattern will not be registered. * @type string $description Optional. Visually hidden text used to describe the pattern * in the inserter. A description is optional, but is strongly * encouraged when the title does not fully describe what the @@ -31569,6 +32115,7 @@ final class WP_Block_Patterns_Registry * of the post types passed on the array. For all the other post types * not part of the array the pattern is not available at all. * @type string[] $templateTypes Optional. An array of template types where the pattern fits. + * @type string $filePath Optional. The full path to the file containing the block pattern content. * } * @return bool True if the pattern was registered with success and false otherwise. * @phpstan-param array{ @@ -31582,6 +32129,7 @@ final class WP_Block_Patterns_Registry * blockTypes?: string[], * postTypes?: string[], * templateTypes?: string[], + * filePath?: string, * } $pattern_properties */ public function register($pattern_name, $pattern_properties) @@ -32013,6 +32561,7 @@ final class WP_Block_Type_Registry * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, + * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], @@ -32023,15 +32572,17 @@ final class WP_Block_Type_Registry * supports?: array|null, * example?: array|null, * render_callback?: callable|null, + * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, - * block_hooks?: array[], + * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], + * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ public function register($name, $args = array()) @@ -32159,6 +32710,13 @@ class WP_Block_Type * @var string[]|null */ public $ancestor = \null; + /** + * Limits which block types can be inserted as children of this block type. + * + * @since 6.5.0 + * @var string[]|null + */ + public $allowed_blocks = \null; /** * Block type icon. * @@ -32196,12 +32754,12 @@ class WP_Block_Type */ public $styles = array(); /** - * Block variations. + * Block variations callback. * - * @since 5.8.0 - * @var array[] + * @since 6.5.0 + * @var callable|null */ - public $variations = array(); + public $variation_callback = \null; /** * Custom CSS selectors for theme.json style generation. * @@ -32237,13 +32795,6 @@ class WP_Block_Type * @var array|null */ public $attributes = \null; - /** - * Context values inherited by blocks of this type. - * - * @since 5.5.0 - * @var string[] - */ - public $uses_context = array(); /** * Context provided by blocks of this type. * @@ -32259,7 +32810,7 @@ class WP_Block_Type * next to the "anchor" block whenever the latter is encountered. * * @since 6.4.0 - * @var array[] + * @var string[] */ public $block_hooks = array(); /** @@ -32283,6 +32834,13 @@ class WP_Block_Type * @var string[] */ public $view_script_handles = array(); + /** + * Block type front end only script module IDs. + * + * @since 6.5.0 + * @var string[] + */ + public $view_script_module_ids = array(); /** * Block type editor only style handles. * @@ -32297,13 +32855,21 @@ class WP_Block_Type * @var string[] */ public $style_handles = array(); + /** + * Block type front end only style handles. + * + * @since 6.5.0 + * @var string[] + */ + public $view_style_handles = array(); /** * Attributes supported by every block. * - * @since 6.0.0 + * @since 6.0.0 Added `lock`. + * @since 6.5.0 Added `metadata`. * @var array */ - const GLOBAL_ATTRIBUTES = array('lock' => array('type' => 'object')); + const GLOBAL_ATTRIBUTES = array('lock' => array('type' => 'object'), 'metadata' => array('type' => 'object')); /** * Constructor. * @@ -32322,6 +32888,7 @@ class WP_Block_Type * 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. * * @see register_block_type() * @@ -32338,6 +32905,7 @@ class WP_Block_Type * available when nested within the specified blocks. * @type string[]|null $ancestor Setting ancestor makes a block available only inside the specified * block types at any position of the ancestor's block subtree. + * @type string[]|null $allowed_blocks Limits which block types can be inserted as children of this block type. * @type string|null $icon Block type icon. * @type string $description A detailed block type description. * @type string[] $keywords Additional keywords to produce block type as @@ -32349,15 +32917,17 @@ class WP_Block_Type * @type array|null $supports Supported features. * @type array|null $example Structured data for the block preview. * @type callable|null $render_callback Block type render callback. + * @type callable|null $variation_callback Block type variations callback. * @type array|null $attributes Block type attributes property schemas. * @type string[] $uses_context Context values inherited by blocks of this type. * @type string[]|null $provides_context Context provided by blocks of this type. - * @type array[] $block_hooks Block hooks. + * @type string[] $block_hooks Block hooks. * @type string[] $editor_script_handles Block type editor only script handles. * @type string[] $script_handles Block type front end and editor script handles. * @type string[] $view_script_handles Block type front end only script handles. * @type string[] $editor_style_handles Block type editor only style handles. * @type string[] $style_handles Block type front end and editor style handles. + * @type string[] $view_style_handles Block type front end only style handles. * } * @phpstan-param array{ * api_version?: string, @@ -32365,6 +32935,7 @@ class WP_Block_Type * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, + * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], @@ -32375,15 +32946,17 @@ class WP_Block_Type * supports?: array|null, * example?: array|null, * render_callback?: callable|null, + * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, - * block_hooks?: array[], + * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], + * view_style_handles?: string[], * } $args */ public function __construct($block_type, $args = array()) @@ -32479,6 +33052,7 @@ public function prepare_attributes_for_render($attributes) * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, + * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], @@ -32489,15 +33063,17 @@ public function prepare_attributes_for_render($attributes) * supports?: array|null, * example?: array|null, * render_callback?: callable|null, + * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, - * block_hooks?: array[], + * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], + * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ public function set_props($args) @@ -32513,6 +33089,26 @@ public function set_props($args) public function get_attributes() { } + /** + * Get block variations. + * + * @since 6.5.0 + * + * @return array[] + */ + public function get_variations() + { + } + /** + * Get block uses context. + * + * @since 6.5.0 + * + * @return array[] + */ + public function get_uses_context() + { + } } /** * Blocks API: WP_Block class @@ -32645,6 +33241,7 @@ public function __get($name) * Generates the render output for the block. * * @since 5.5.0 + * @since 6.5.0 Added block bindings processing. * * @global WP_Post $post Global post object. * @@ -32995,7 +33592,7 @@ public function __construct($query = '') * * @since 4.2.0 Extracted from WP_Comment_Query::query(). * - * @param string|array $query WP_Comment_Query arguments. See WP_Comment_Query::__construct() + * @param string|array $query WP_Comment_Query arguments. See WP_Comment_Query::__construct() for accepted arguments. * @phpstan-param array{ * author_email?: string, * author_url?: string, @@ -35478,12 +36075,18 @@ public function available_item_types() * @param array $postarr { * Post array. Note that post_status is overridden to be `auto-draft`. * - * @var string $post_title Post title. Required. - * @var string $post_type Post type. Required. - * @var string $post_name Post name. - * @var string $post_content Post content. + * @type string $post_title Post title. Required. + * @type string $post_type Post type. Required. + * @type string $post_name Post name. + * @type string $post_content Post content. * } * @return WP_Post|WP_Error Inserted auto-draft post object or error. + * @phpstan-param array{ + * post_title?: string, + * post_type?: string, + * post_name?: string, + * post_content?: string, + * } $postarr */ public function insert_auto_draft_post($postarr) { @@ -37812,7 +38415,7 @@ public function build_value($compare, $value) * * @since 3.7.0 * - * @param string|array $datetime An array of parameters or a strotime() string. + * @param string|array $datetime An array of parameters or a strtotime() string. * @param bool $default_to_max Whether to round up incomplete dates. Supported by values * of $datetime that are arrays, or string values that are a * subset of MySQL date format ('Y', 'Y-m', 'Y-m-d', 'Y-m-d H:i'). @@ -37849,7 +38452,8 @@ public function build_time_query($column, $compare, $hour = \null, $minute = \nu * @since 6.0.3 * * @param string $relation Raw relation key from the query argument. - * @return string Sanitized relation ('AND' or 'OR'). + * @return string Sanitized relation. Either 'AND' or 'OR'. + * @phpstan-return 'AND'|'OR' */ public function sanitize_relation($relation) { @@ -38485,6 +39089,8 @@ public static function parse_settings($editor_id, $settings) * * @since 3.3.0 * + * @global WP_Screen $current_screen WordPress current screen object. + * * @param string $content Initial content for the editor. * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. * Should not contain square brackets. @@ -39090,6 +39696,8 @@ class WP_Fatal_Error_Handler * This method is registered via `register_shutdown_function()`. * * @since 5.2.0 + * + * @global WP_Locale $wp_locale WordPress date and time locale object. * @phpstan-return void */ public function handle() @@ -40715,7 +41323,7 @@ public function _get_first_available_transport($args, $url = \null) * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. - * A WP_Error instance upon error. + * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function post($url, $args = array()) @@ -40731,7 +41339,7 @@ public function post($url, $args = array()) * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. - * A WP_Error instance upon error. + * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function get($url, $args = array()) @@ -40747,7 +41355,7 @@ public function get($url, $args = array()) * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. - * A WP_Error instance upon error. + * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function head($url, $args = array()) @@ -43193,7 +43801,7 @@ public function __construct($query = '') * * @since 4.6.0 * - * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() + * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() for accepted arguments. * @phpstan-param array{ * network__in?: int[], * network__not_in?: int[], @@ -44095,7 +44703,7 @@ public function _strip_newlines($html, $data, $url) class WP_Paused_Extensions_Storage { /** - * Type of extension. Used to key extension storage. + * Type of extension. Used to key extension storage. Either 'plugin' or 'theme'. * * @since 5.2.0 * @var string @@ -44208,6 +44816,372 @@ protected function get_option_name() { } } + /** + * WordPress Plugin Administration API: WP_Plugin_Dependencies class + * + * @package WordPress + * @subpackage Administration + * @since 6.5.0 + */ + /** + * Core class for installing plugin dependencies. + * + * It is designed to add plugin dependencies as designated in the + * `Requires Plugins` header to a new view in the plugins install page. + */ + class WP_Plugin_Dependencies + { + /** + * Holds 'get_plugins()'. + * + * @since 6.5.0 + * + * @var array + */ + protected static $plugins; + /** + * Holds plugin directory names to compare with cache. + * + * @since 6.5.0 + * + * @var array + */ + protected static $plugin_dirnames; + /** + * Holds sanitized plugin dependency slugs. + * + * Keyed on the dependent plugin's filepath, + * relative to the plugins directory. + * + * @since 6.5.0 + * + * @var array + */ + protected static $dependencies; + /** + * Holds an array of sanitized plugin dependency slugs. + * + * @since 6.5.0 + * + * @var array + */ + protected static $dependency_slugs; + /** + * Holds an array of dependent plugin slugs. + * + * Keyed on the dependent plugin's filepath, + * relative to the plugins directory. + * + * @since 6.5.0 + * + * @var array + */ + protected static $dependent_slugs; + /** + * Holds 'plugins_api()' data for plugin dependencies. + * + * @since 6.5.0 + * + * @var array + */ + protected static $dependency_api_data; + /** + * Holds plugin dependency filepaths, relative to the plugins directory. + * + * Keyed on the dependency's slug. + * + * @since 6.5.0 + * + * @var string[] + */ + protected static $dependency_filepaths; + /** + * An array of circular dependency pairings. + * + * @since 6.5.0 + * + * @var array[] + */ + protected static $circular_dependencies_pairs; + /** + * An array of circular dependency slugs. + * + * @since 6.5.0 + * + * @var string[] + */ + protected static $circular_dependencies_slugs; + /** + * Whether Plugin Dependencies have been initialized. + * + * @since 6.5.0 + * + * @var bool + */ + protected static $initialized = \false; + /** + * Initializes by fetching plugin header and plugin API data. + * + * @since 6.5.0 + */ + public static function initialize() + { + } + /** + * Determines whether the plugin has plugins that depend on it. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return bool Whether the plugin has plugins that depend on it. + */ + public static function has_dependents($plugin_file) + { + } + /** + * Determines whether the plugin has plugin dependencies. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return bool Whether a plugin has plugin dependencies. + */ + public static function has_dependencies($plugin_file) + { + } + /** + * Determines whether the plugin has active dependents. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return bool Whether the plugin has active dependents. + */ + public static function has_active_dependents($plugin_file) + { + } + /** + * Gets filepaths of plugins that require the dependency. + * + * @since 6.5.0 + * + * @param string $slug The dependency's slug. + * @return array An array of dependent plugin filepaths, relative to the plugins directory. + */ + public static function get_dependents($slug) + { + } + /** + * Gets the slugs of plugins that the dependent requires. + * + * @since 6.5.0 + * + * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. + * @return array An array of dependency plugin slugs. + */ + public static function get_dependencies($plugin_file) + { + } + /** + * Gets a dependent plugin's filepath. + * + * @since 6.5.0 + * + * @param string $slug The dependent plugin's slug. + * @return string|false The dependent plugin's filepath, relative to the plugins directory, + * or false if the plugin has no dependencies. + */ + public static function get_dependent_filepath($slug) + { + } + /** + * Determines whether the plugin has unmet dependencies. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return bool Whether the plugin has unmet dependencies. + */ + public static function has_unmet_dependencies($plugin_file) + { + } + /** + * Determines whether the plugin has a circular dependency. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return bool Whether the plugin has a circular dependency. + */ + public static function has_circular_dependency($plugin_file) + { + } + /** + * Gets the names of plugins that require the plugin. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return array An array of dependent names. + */ + public static function get_dependent_names($plugin_file) + { + } + /** + * Gets the names of plugins required by the plugin. + * + * @since 6.5.0 + * + * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. + * @return array An array of dependency names. + */ + public static function get_dependency_names($plugin_file) + { + } + /** + * Gets the filepath for a dependency, relative to the plugin's directory. + * + * @since 6.5.0 + * + * @param string $slug The dependency's slug. + * @return string|false If installed, the dependency's filepath relative to the plugins directory, otherwise false. + */ + public static function get_dependency_filepath($slug) + { + } + /** + * Returns API data for the dependency. + * + * @since 6.5.0 + * + * @param string $slug The dependency's slug. + * @return array|false The dependency's API data on success, otherwise false. + */ + public static function get_dependency_data($slug) + { + } + /** + * Displays an admin notice if dependencies are not installed. + * + * @since 6.5.0 + */ + public static function display_admin_notice_for_unmet_dependencies() + { + } + /** + * Displays an admin notice if circular dependencies are installed. + * + * @since 6.5.0 + */ + public static function display_admin_notice_for_circular_dependencies() + { + } + /** + * Checks plugin dependencies after a plugin is installed via AJAX. + * + * @since 6.5.0 + */ + public static function check_plugin_dependencies_during_ajax() + { + } + /** + * Gets data for installed plugins. + * + * @since 6.5.0 + * + * @return array An array of plugin data. + */ + 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() + { + } + /** + * Sanitizes slugs. + * + * @since 6.5.0 + * + * @param string $slugs A comma-separated string of plugin dependency slugs. + * @return array An array of sanitized plugin dependency slugs. + */ + protected static function sanitize_dependency_slugs($slugs) + { + } + /** + * Gets the filepath of installed dependencies. + * If a dependency is not installed, the filepath defaults to false. + * + * @since 6.5.0 + * + * @return array An array of install dependencies filepaths, relative to the plugins directory. + */ + protected static function get_dependency_filepaths() + { + } + /** + * Retrieves and stores dependency plugin data from the WordPress.org Plugin API. + * + * @since 6.5.0 + * + * @global string $pagenow The filename of the current screen. + * + * @return array|void An array of dependency API data, or void on early exit. + */ + protected static function get_dependency_api_data() + { + } + /** + * Gets plugin directory names. + * + * @since 6.5.0 + * + * @return array An array of plugin directory names. + */ + protected static function get_plugin_dirnames() + { + } + /** + * Gets circular dependency data. + * + * @since 6.5.0 + * + * @return array[] An array of circular dependency pairings. + */ + protected static function get_circular_dependencies() + { + } + /** + * Checks for circular dependencies. + * + * @since 6.5.0 + * + * @param array $dependents Array of dependent plugins. + * @param array $dependencies Array of plugins dependencies. + * @return array A circular dependency pairing, or an empty array if none exists. + */ + protected static function check_for_circular_dependencies($dependents, $dependencies) + { + } + /** + * Converts a plugin filepath to a slug. + * + * @since 6.5.0 + * + * @param string $plugin_file The plugin's filepath, relative to the plugins directory. + * @return string The plugin's slug. + */ + protected static function convert_to_slug($plugin_file) + { + } + } /** * Post API: WP_Post_Type class * @@ -44646,7 +45620,7 @@ final class WP_Post_Type * capability_type?: string|array, * capabilities?: string[], * map_meta_cap?: bool, - * supports?: array, + * supports?: array|false, * register_meta_box_cb?: callable, * taxonomies?: string[], * has_archive?: bool|string, @@ -45126,7 +46100,7 @@ class WP_Query * Taxonomy query, as passed to get_tax_sql(). * * @since 3.1.0 - * @var WP_Tax_Query A taxonomy query instance. + * @var WP_Tax_Query|null A taxonomy query instance. */ public $tax_query; /** @@ -46445,7 +47419,7 @@ public function is_embed() * * @since 3.3.0 * - * @global WP_Query $wp_query WordPress Query object. + * @global WP_Query $wp_the_query WordPress Query object. * * @return bool Whether the query is the main query. */ @@ -46693,7 +47667,7 @@ public function generate_recovery_mode_token() * * @since 5.2.0 * - * @global PasswordHash $wp_hasher + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param string $token A token generated by {@see generate_recovery_mode_token()}. * @return string Recovery mode key. @@ -46708,7 +47682,7 @@ public function generate_and_store_recovery_mode_key($token) * * @since 5.2.0 * - * @global PasswordHash $wp_hasher + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param string $token The token used when generating the given key. * @param string $key The unhashed key. @@ -48216,6 +49190,163 @@ protected function get_roles_data() { } } + /** + * Script Modules API: WP_Script_Modules class. + * + * Native support for ES Modules and Import Maps. + * + * @package WordPress + * @subpackage Script Modules + */ + /** + * Core class used to register script modules. + * + * @since 6.5.0 + */ + class WP_Script_Modules + { + /** + * Registers the script module if no script module with that script module + * identifier has already been registered. + * + * @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. + * @phpstan-param array $deps + */ + public function register(string $id, string $src, array $deps = array(), $version = \false) + { + } + /** + * Marks the script module to be enqueued in the page. + * + * If a src is provided and the script module has not been registered yet, it + * will be registered. + * + * @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. + * @phpstan-param array $deps + */ + public function enqueue(string $id, string $src = '', array $deps = array(), $version = \false) + { + } + /** + * Unmarks the script module so it will no longer be enqueued in the page. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ + public function dequeue(string $id) + { + } + /** + * Removes a registered script module. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ + public function deregister(string $id) + { + } + /** + * Adds the hooks to print the import map, enqueued script modules and script + * module preloads. + * + * In classic themes, the script modules used by the blocks are not yet known + * when the `wp_head` actions is fired, so it needs to print everything in the + * footer. + * + * @since 6.5.0 + */ + public function add_hooks() + { + } + /** + * Prints the enqueued script modules using script tags with type="module" + * attributes. + * + * @since 6.5.0 + */ + public function print_enqueued_script_modules() + { + } + /** + * Prints the the static dependencies of the enqueued script modules using + * link tags with rel="modulepreload" attributes. + * + * If a script module is marked for enqueue, it will not be preloaded. + * + * @since 6.5.0 + */ + public function print_script_module_preloads() + { + } + /** + * Prints the import map using a script tag with a type="importmap" attribute. + * + * @since 6.5.0 + * + * @global WP_Scripts $wp_scripts The WP_Scripts object for printing the polyfill. + */ + public function print_import_map() + { + } + } /** * Dependencies API: WP_Scripts class * @@ -49031,11 +50162,11 @@ class WP_Site_Query * @type string $path Limit results to those affiliated with a given path. Default empty. * @type string[] $path__in Array of paths to include affiliated sites for. Default empty. * @type string[] $path__not_in Array of paths to exclude affiliated sites for. Default empty. - * @type int $public Limit results to public sites. Accepts '1' or '0'. Default empty. - * @type int $archived Limit results to archived sites. Accepts '1' or '0'. Default empty. - * @type int $mature Limit results to mature sites. Accepts '1' or '0'. Default empty. - * @type int $spam Limit results to spam sites. Accepts '1' or '0'. Default empty. - * @type int $deleted Limit results to deleted sites. Accepts '1' or '0'. Default empty. + * @type int $public Limit results to public sites. Accepts 1 or 0. Default empty. + * @type int $archived Limit results to archived sites. Accepts 1 or 0. Default empty. + * @type int $mature Limit results to mature sites. Accepts 1 or 0. Default empty. + * @type int $spam Limit results to spam sites. Accepts 1 or 0. Default empty. + * @type int $deleted Limit results to deleted sites. Accepts 1 or 0. Default empty. * @type int $lang_id Limit results to a language ID. Default empty. * @type string[] $lang__in Array of language IDs to include affiliated sites for. Default empty. * @type string[] $lang__not_in Array of language IDs to exclude affiliated sites for. Default empty. @@ -49765,7 +50896,8 @@ public function sanitize_query($queries) * @since 4.1.0 * * @param string $relation Raw relation key from the query argument. - * @return string Sanitized relation ('AND' or 'OR'). + * @return string Sanitized relation. Either 'AND' or 'OR'. + * @phpstan-return 'AND'|'OR' */ public function sanitize_relation($relation) { @@ -50516,7 +51648,7 @@ public function __construct($query = '') * * @since 4.6.0 * - * @param string|array $query WP_Term_Query arguments. See WP_Term_Query::__construct() + * @param string|array $query WP_Term_Query arguments. See WP_Term_Query::__construct() for accepted arguments. * @phpstan-param array{ * taxonomy?: string|string[], * object_ids?: int|int[], @@ -51231,8 +52363,11 @@ class WP_Textdomain_Registry * Holds a cached list of available .mo files to improve performance. * * @since 6.1.0 + * @since 6.5.0 This property is no longer used. * * @var array + * + * @deprecated */ protected $cached_mo_files = array(); /** @@ -51243,6 +52378,17 @@ class WP_Textdomain_Registry * @var string[] */ protected $domains_with_translations = array(); + /** + * Initializes the registry. + * + * Hooks into the {@see 'upgrader_process_complete'} filter + * to invalidate MO files caches. + * + * @since 6.5.0 + */ + public function init() + { + } /** * Returns the languages directory path for a specific domain and locale. * @@ -51299,6 +52445,66 @@ public function set($domain, $locale, $path) public function set_custom_path($domain, $path) { } + /** + * Retrieves translation files from the specified path. + * + * Allows early retrieval through the {@see 'pre_get_mo_files_from_path'} filter to optimize + * performance, especially in directories with many files. + * + * @since 6.5.0 + * + * @param string $path The directory path to search for translation files. + * @return array Array of translation file paths. Can contain .mo and .l10n.php files. + */ + public function get_language_files_from_path($path) + { + } + /** + * Invalidate the cache for .mo files. + * + * This function deletes the cache entries related to .mo files when triggered + * by specific actions, such as the completion of an upgrade process. + * + * @since 6.5.0 + * + * @param WP_Upgrader $upgrader Unused. WP_Upgrader instance. In other contexts this might be a + * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. + * @param array $hook_extra { + * Array of bulk item update data. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type array $plugins Array of the basename paths of the plugins' main files. + * @type array $themes The theme slugs. + * @type array $translations { + * Array of translations update data. + * + * @type string $language The locale the translation is for. + * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'. + * @type string $slug Text domain the translation is for. The slug of a theme/plugin or + * 'default' for core translations. + * @type string $version The version of a theme, plugin, or core. + * } + * } + * @phpstan-param array{ + * action?: string, + * type?: string, + * bulk?: bool, + * plugins?: array, + * themes?: array, + * translations?: array{ + * language: string, + * type: string, + * slug: string, + * version: string, + * }, + * } $hook_extra + * @phpstan-return void + */ + public function invalidate_mo_files_cache($upgrader, $hook_extra) + { + } } /** * WP_Theme_JSON_Data class @@ -51830,10 +53036,11 @@ class WP_Theme_JSON * @since 6.2.0 Added `outline-*`, and `min-height` properties. * @since 6.3.0 Added `column-count` property. * @since 6.4.0 Added `writing-mode` property. + * @since 6.5.0 Added `aspect-ratio` property. * * @var array */ - const PROPERTIES_METADATA = array('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'), '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')); /** * Indirect metadata for style properties that are not directly output. * @@ -51885,9 +53092,19 @@ class WP_Theme_JSON * @since 6.3.0 Added support for `typography.textColumns`, removed `layout.definitions`. * @since 6.4.0 Added support for `layout.allowEditing`, `background.backgroundImage`, * `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`. + * @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize`, + * `background.backgroundSize` and `dimensions.aspectRatio`. * @var array */ - const VALID_SETTINGS = array('appearanceTools' => \null, 'useRootPaddingAwareAlignments' => \null, 'background' => array('backgroundImage' => \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('minHeight' => \null), 'layout' => array('contentSize' => \null, 'wideSize' => \null, 'allowEditing' => \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, '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)); + /* + * The valid properties for fontFamilies under settings key. + * + * @since 6.5.0 + * + * @var array + */ + const FONT_FAMILY_SCHEMA = array(array('fontFamily' => \null, 'name' => \null, 'slug' => \null, 'fontFace' => array(array('ascentOverride' => \null, 'descentOverride' => \null, 'fontDisplay' => \null, 'fontFamily' => \null, 'fontFeatureSettings' => \null, 'fontStyle' => \null, 'fontStretch' => \null, 'fontVariationSettings' => \null, 'fontWeight' => \null, 'lineGapOverride' => \null, 'sizeAdjust' => \null, 'src' => \null, 'unicodeRange' => \null)))); /** * The valid properties under the styles key. * @@ -51900,10 +53117,11 @@ class WP_Theme_JSON * updated `blockGap` to be allowed at any level. * @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`. * * @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('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('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); /** * Defines which pseudo selectors are enabled for which elements. * @@ -51951,6 +53169,47 @@ class WP_Theme_JSON * @var string[] */ const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = array('__experimentalBorder' => 'border', 'color' => 'color', 'spacing' => 'spacing', 'typography' => 'typography'); + /** + * Return the input schema at the root and per origin. + * + * @since 6.5.0 + * + * @param array $schema The base schema. + * @return array The schema at the root and per origin. + * + * Example: + * schema_in_root_and_per_origin( + * array( + * 'fontFamily' => null, + * 'slug' => null, + * ) + * ) + * + * Returns: + * array( + * 'fontFamily' => null, + * 'slug' => null, + * 'default' => array( + * 'fontFamily' => null, + * 'slug' => null, + * ), + * 'blocks' => array( + * 'fontFamily' => null, + * 'slug' => null, + * ), + * 'theme' => array( + * 'fontFamily' => null, + * 'slug' => null, + * ), + * 'custom' => array( + * 'fontFamily' => null, + * 'slug' => null, + * ), + * ) + */ + protected static function schema_in_root_and_per_origin($schema) + { + } /** * Returns a class name by an element name. * @@ -51968,9 +53227,10 @@ public static function get_element_class_name($element) * @since 6.0.0 * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`. * @since 6.4.0 Added `background.backgroundImage`. + * @since 6.5.0 Added `background.backgroundSize` and `dimensions.aspectRatio`. * @var array */ - const APPEARANCE_TOOLS_OPT_INS = array(array('background', 'backgroundImage'), array('border', 'color'), array('border', 'radius'), array('border', 'style'), array('border', 'width'), array('color', 'link'), array('color', 'heading'), array('color', 'button'), array('color', 'caption'), array('dimensions', 'minHeight'), array('position', 'sticky'), array('spacing', 'blockGap'), array('spacing', 'margin'), array('spacing', 'padding'), array('typography', 'lineHeight')); + const APPEARANCE_TOOLS_OPT_INS = array(array('background', 'backgroundImage'), array('background', 'backgroundSize'), array('border', 'color'), array('border', 'radius'), array('border', 'style'), array('border', 'width'), array('color', 'link'), array('color', 'heading'), array('color', 'button'), array('color', 'caption'), array('dimensions', 'aspectRatio'), array('dimensions', 'minHeight'), array('position', 'sticky'), array('spacing', 'blockGap'), array('spacing', 'margin'), array('spacing', 'padding'), array('typography', 'lineHeight')); /** * The latest version of the schema in use. * @@ -52494,6 +53754,7 @@ protected static function flatten_tree($tree, $prefix = '', $token = '--') * @since 5.8.0 * @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. * * @param array $styles Styles to process. * @param array $settings Theme settings. @@ -52874,6 +54135,18 @@ protected function get_feature_declarations_for_node($metadata, &$node) public static function resolve_variables($theme_json) { } + /** + * Generates a selector for a block style variation. + * + * @since 6.5.0 + * + * @param string $variation_name Name of the block style variation. + * @param string $block_selector CSS selector for the block. + * @return string Block selector with block style variation selector added to it. + */ + protected static function get_block_style_variation_selector($variation_name, $block_selector) + { + } } /** * WP_Theme Class @@ -54165,6 +55438,8 @@ class WP_User * * @since 2.0.0 * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int|string|stdClass|WP_User $id User's ID, a WP_User object, or a user object from the DB. * @param string $name Optional. User's username * @param int $site_id Optional Site ID, defaults to current site. @@ -54192,7 +55467,7 @@ public function init($data, $site_id = '') * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $field The field to query against: 'id', 'ID', 'slug', 'email' or 'login'. + * @param string $field The field to query against: Accepts 'id', 'ID', 'slug', 'email' or 'login'. * @param string|int $value The field value. * @return object|false Raw user object. * @phpstan-param 'id'|'ID'|'slug'|'email'|'login' $field @@ -57698,7 +58973,7 @@ class wpdb */ protected $result; /** - * Cached column info, for sanity checking data before inserting. + * Cached column info, for confidence checking data before inserting. * * @since 4.2.0 * @@ -57714,7 +58989,7 @@ class wpdb */ protected $table_charset = array(); /** - * Whether text fields in the current query need to be sanity checked. + * Whether text fields in the current query need to be confidence checked. * * @since 4.2.0 * @@ -62486,6 +63761,60 @@ public function active_callback() { } } + /** + * Font Collection class. + * + * This file contains the Font Collection class definition. + * + * @package WordPress + * @subpackage Fonts + * @since 6.5.0 + */ + /** + * Font Collection class. + * + * @since 6.5.0 + * + * @see wp_register_font_collection() + */ + final class WP_Font_Collection + { + /** + * The unique slug for the font collection. + * + * @since 6.5.0 + * @var string + */ + public $slug; + /** + * WP_Font_Collection constructor. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, + * and underscores. See sanitize_title(). + * @param array $args Font collection data. See wp_register_font_collection() for information on accepted arguments. + * @phpstan-param array{ + * name?: string, + * description?: string, + * font_families?: array|string, + * categories?: array, + * } $args See wp_register_font_collection() + */ + public function __construct(string $slug, array $args) + { + } + /** + * Retrieves the font collection data. + * + * @since 6.5.0 + * + * @return array|WP_Error An array containing the font collection data, or a WP_Error on failure. + */ + public function get_data() + { + } + } /** * WP_Font_Face_Resolver class. * @@ -62545,32 +63874,202 @@ 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[]{ - * font-family?: string{ - * font_variation?: array{ - * font-family: string, - * src: string|string[], - * font_style?: string, - * font-weight?: string, - * font-display?: string, - * ascent-override?: string, - * descent-override?: string, - * font-stretch?: string, - * font-variant?: string, - * font-feature-settings?: string, - * font-variation-settings?: string, - * line-gap-override?: string, - * size-adjust?: string, - * unicode-range?: string, - * }, - * }, - * } $fonts See wp_print_font_faces() * @phpstan-return void */ public function generate_and_print(array $fonts) { } } + /** + * Font Library class. + * + * This file contains the Font Library class definition. + * + * @package WordPress + * @subpackage Fonts + * @since 6.5.0 + */ + /** + * Font Library class. + * + * @since 6.5.0 + */ + class WP_Font_Library + { + /** + * Register a new font collection. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, + * and underscores. See sanitize_title(). + * @param array $args Font collection data. See wp_register_font_collection() for information on accepted arguments. + * @return WP_Font_Collection|WP_Error A font collection if it was registered successfully, + * or WP_Error object on failure. + * @phpstan-param array{ + * name?: string, + * description?: string, + * font_families?: array|string, + * categories?: array, + * } $args See wp_register_font_collection() + */ + public function register_font_collection(string $slug, array $args) + { + } + /** + * Unregisters a previously registered font collection. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. + * @return bool True if the font collection was unregistered successfully and false otherwise. + */ + public function unregister_font_collection(string $slug) + { + } + /** + * Gets all the font collections available. + * + * @since 6.5.0 + * + * @return array List of font collections. + */ + public function get_font_collections() + { + } + /** + * Gets a font collection. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. + * @return WP_Font_Collection|null Font collection object, or null if the font collection doesn't exist. + */ + public function get_font_collection(string $slug) + { + } + /** + * Utility method to retrieve the main instance of the class. + * + * The instance will be created if it does not exist yet. + * + * @since 6.5.0 + * + * @return WP_Font_Library The main instance. + */ + public static function get_instance() + { + } + } + /** + * Font Utils class. + * + * Provides utility functions for working with font families. + * + * @package WordPress + * @subpackage Fonts + * @since 6.5.0 + */ + /** + * A class of utilities for working with the Font Library. + * + * These utilities may change or be removed in the future and are intended for internal use only. + * + * @since 6.5.0 + * @access private + */ + class WP_Font_Utils + { + /** + * Sanitizes and formats font family names. + * + * - Applies `sanitize_text_field`. + * - Adds surrounding quotes to names containing any characters that are not alphabetic or dashes. + * + * It follows the recommendations from the CSS Fonts Module Level 4. + * @link https://www.w3.org/TR/css-fonts-4/#font-family-prop + * + * @since 6.5.0 + * @access private + * + * @see sanitize_text_field() + * + * @param string $font_family Font family name(s), comma-separated. + * @return string Sanitized and formatted font family name(s). + */ + public static function sanitize_font_family($font_family) + { + } + /** + * Generates a slug from font face properties, e.g. `open sans;normal;400;100%;U+0-10FFFF` + * + * Used for comparison with other font faces in the same family, to prevent duplicates + * that would both match according the CSS font matching spec. Uses only simple case-insensitive + * matching for fontFamily and unicodeRange, so does not handle overlapping font-family lists or + * unicode ranges. + * + * @since 6.5.0 + * @access private + * + * @link https://drafts.csswg.org/css-fonts/#font-style-matching + * + * @param array $settings { + * Font face settings. + * + * @type string $fontFamily Font family name. + * @type string $fontStyle Optional font style, defaults to 'normal'. + * @type string $fontWeight Optional font weight, defaults to 400. + * @type string $fontStretch Optional font stretch, defaults to '100%'. + * @type string $unicodeRange Optional unicode range, defaults to 'U+0-10FFFF'. + * } + * @return string Font face slug. + * @phpstan-param array{ + * fontFamily?: string, + * fontStyle?: string, + * fontWeight?: string, + * fontStretch?: string, + * unicodeRange?: string, + * } $settings + */ + public static function get_font_face_slug($settings) + { + } + /** + * Sanitizes a tree of data using a schema. + * + * The schema structure should mirror the data tree. Each value provided in the + * schema should be a callable that will be applied to sanitize the corresponding + * value in the data tree. Keys that are in the data tree, but not present in the + * schema, will be removed in the sanitized data. Nested arrays are traversed recursively. + * + * @since 6.5.0 + * + * @access private + * + * @param array $tree The data to sanitize. + * @param array $schema The schema used for sanitization. + * @return array The sanitized data. + */ + public static function sanitize_from_schema($tree, $schema) + { + } + /** + * Returns the expected mime-type values for font files, depending on PHP version. + * + * This is needed because font mime types vary by PHP version, so checking the PHP version + * is necessary until a list of valid mime-types for each file extension can be provided to + * the 'upload_mimes' filter. + * + * @since 6.5.0 + * + * @access private + * + * @return array A collection of mime types keyed by file extension. + */ + public static function get_allowed_font_mime_types() + { + } + } /** * HTML API: WP_HTML_Active_Formatting_Elements class * @@ -62721,6 +64220,7 @@ public function walk_up() * * @access private * @since 6.2.0 + * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * * @see WP_HTML_Tag_Processor */ @@ -62730,6 +64230,7 @@ class WP_HTML_Attribute_Token * Attribute name. * * @since 6.2.0 + * * @var string */ public $name; @@ -62737,6 +64238,7 @@ class WP_HTML_Attribute_Token * Attribute value. * * @since 6.2.0 + * * @var int */ public $value_starts_at; @@ -62744,6 +64246,7 @@ class WP_HTML_Attribute_Token * How many bytes the value occupies in the input HTML. * * @since 6.2.0 + * * @var int */ public $value_length; @@ -62751,20 +64254,41 @@ class WP_HTML_Attribute_Token * The string offset where the attribute name starts. * * @since 6.2.0 + * * @var int */ public $start; /** - * The string offset after the attribute value or its name. + * Byte length of text spanning the attribute inside a tag. + * + * This span starts at the first character of the attribute name + * and it ends after one of three cases: + * + * - at the end of the attribute name for boolean attributes. + * - at the end of the value for unquoted attributes. + * - at the final single or double quote for quoted attributes. + * + * Example: + * + *
+ * ------------ length is 12, including quotes + * + * + * ------- length is 6 + * + * + * ------------ length is 11 + * + * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * - * @since 6.2.0 * @var int */ - public $end; + public $length; /** * Whether the attribute is a boolean attribute with value `true`. * * @since 6.2.0 + * * @var bool */ public $is_true; @@ -62772,15 +64296,16 @@ class WP_HTML_Attribute_Token * Constructor. * * @since 6.2.0 + * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * * @param string $name Attribute name. * @param int $value_start Attribute value. * @param int $value_length Number of bytes attribute value spans. * @param int $start The string offset where the attribute name starts. - * @param int $end The string offset after the attribute value or its name. + * @param int $length Byte length of the entire attribute name or name and value pair expression. * @param bool $is_true Whether the attribute is a boolean attribute with true value. */ - public function __construct($name, $value_start, $value_length, $start, $end, $is_true) + public function __construct($name, $value_start, $value_length, $start, $length, $is_true) { } } @@ -62889,11 +64414,10 @@ public function has_element_in_scope($tag_name) * Returns whether a particular element is in list item scope. * * @since 6.4.0 + * @since 6.5.0 Implemented: no longer throws on every invocation. * * @see https://html.spec.whatwg.org/#has-an-element-in-list-item-scope * - * @throws WP_HTML_Unsupported_Exception Always until this function is implemented. - * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ @@ -63043,8 +64567,11 @@ public function walk_down() * see WP_HTML_Open_Elements::walk_down(). * * @since 6.4.0 + * @since 6.5.0 Accepts $above_this_node to start traversal above a given node, if it exists. + * + * @param ?WP_HTML_Token $above_this_node Start traversing above this node, if provided and if the node exists. */ - public function walk_up() + public function walk_up($above_this_node = \null) { } /* @@ -63231,9 +64758,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. - * - Decode HTML character references within class names when matching. E.g. match having - * class `1<"2` needs to recognize `class="1<"2"`. Currently the Tag Processor - * will fail to find the right tag if the class name is encoded as such. * - 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 @@ -63322,6 +64846,56 @@ public function __construct() * given, it will return `true` (the only way to set `false` for an * attribute is to remove it). * + * #### When matching fails + * + * When `next_tag()` returns `false` it could mean different things: + * + * - The requested tag wasn't found in the input document. + * - The input document ended in the middle of an HTML syntax element. + * + * When a document ends in the middle of a syntax element it will pause + * the processor. This is to make it possible in the future to extend the + * input document and proceed - an important requirement for chunked + * streaming parsing of a document. + * + * Example: + * + * $processor = new WP_HTML_Tag_Processor( 'This
` inside an HTML comment. + * - STYLE content is raw text. + * - TITLE content is plain text but character references are decoded. + * - TEXTAREA content is plain text but character references are decoded. + * - XMP (deprecated) content is raw text. + * * ### Modifying HTML attributes for a found tag * * Once you've found the start of an opening tag you can modify @@ -63415,6 +64989,95 @@ public function __construct() * } * } * + * ## Tokens and finer-grained processing. + * + * It's possible to scan through every lexical token in the + * HTML document using the `next_token()` function. This + * alternative form takes no argument and provides no built-in + * query syntax. + * + * Example: + * + * $title = '(untitled)'; + * $text = ''; + * while ( $processor->next_token() ) { + * switch ( $processor->get_token_name() ) { + * case '#text': + * $text .= $processor->get_modifiable_text(); + * break; + * + * case 'BR': + * $text .= "\n"; + * break; + * + * case 'TITLE': + * $title = $processor->get_modifiable_text(); + * break; + * } + * } + * return trim( "# {$title}\n\n{$text}" ); + * + * ### Tokens and _modifiable text_. + * + * #### Special "atomic" HTML elements. + * + * Not all HTML elements are able to contain other elements inside of them. + * For instance, the contents inside a TITLE element are plaintext (except + * that character references like & will be decoded). This means that + * if the string `` appears inside a TITLE element, then it's not an + * image tag, but rather it's text describing an image tag. Likewise, the + * contents of a SCRIPT or STYLE element are handled entirely separately in + * a browser than the contents of other elements because they represent a + * different language than HTML. + * + * For these elements the Tag Processor treats the entire sequence as one, + * from the opening tag, including its contents, through its closing tag. + * This means that the it's not possible to match the closing tag for a + * SCRIPT element unless it's unexpected; the Tag Processor already matched + * it when it found the opening tag. + * + * The inner contents of these elements are that element's _modifiable text_. + * + * 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( '' )`. + * - `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 + * raw plaintext and left as-is. E.g. `1 < 2 < 3` remains `1 < 2 < 3`. + * + * #### Other tokens with modifiable text. + * + * There are also non-elements which are void/self-closing in nature and contain + * modifiable text that is part of that individual syntax token itself. + * + * - `#text` nodes, whose entire token _is_ the modifiable text. + * - HTML comments and tokens that become comments due to some syntax error. The + * text for these tokens is the portion of the comment inside of the syntax. + * E.g. for `` the text is `" comment "` (note the spaces are included). + * - `CDATA` sections, whose text is the content inside of the section itself. E.g. for + * `` the text is `"some content"` (with restrictions [1]). + * - "Funky comments," which are a special case of invalid closing tags whose name is + * invalid. The text for these nodes is the text that a browser would transform into + * an HTML comment when parsing. E.g. for `` the text is `%post_author`. + * - `DOCTYPE` declarations like `` which have no closing tag. + * - XML Processing instruction nodes like `` (with restrictions [2]). + * - The empty end tag `` which is ignored in the browser and DOM. + * + * [1]: There are no CDATA sections in HTML. When encountering `` becomes a bogus HTML comment, meaning there can be no CDATA + * section in an HTML document containing `>`. The Tag Processor will first find + * all valid and bogus HTML comments, and then if the comment _would_ have been a + * CDATA section _were they to exist_, it will indicate this as the type of comment. + * + * [2]: XML allows a broader range of characters in a processing instruction's target name + * and disallows "xml" as a name, since it's special. The Tag Processor only recognizes + * target names with an ASCII-representable subset of characters. It also exhibits the + * same constraint as with CDATA sections, in that `>` cannot exist within the token + * since Processing Instructions do no exist within HTML and their syntax transforms + * into a bogus comment in the DOM. + * * ## Design and limitations * * The Tag Processor is designed to linearly scan HTML documents and tokenize @@ -63456,9 +65119,40 @@ public function __construct() * double-quoted strings, meaning that attributes on input with single-quoted or * unquoted values will appear in the output with double-quotes. * + * ### Scripting Flag + * + * The Tag Processor parses HTML with the "scripting flag" disabled. This means + * that it doesn't run any scripts while parsing the page. In a browser with + * JavaScript enabled, for example, the script can change the parse of the + * document as it loads. On the server, however, evaluating JavaScript is not + * only impractical, but also unwanted. + * + * Practically this means that the Tag Processor will descend into NOSCRIPT + * elements and process its child tags. Were the scripting flag enabled, such + * as in a typical browser, the contents of NOSCRIPT are skipped entirely. + * + * This allows the HTML API to process the content that will be presented in + * a browser when scripting is disabled, but it offers a different view of a + * page than most browser sessions will experience. E.g. the tags inside the + * NOSCRIPT disappear. + * + * ### Text Encoding + * + * The Tag Processor assumes that the input HTML document is encoded with a + * text encoding compatible with 7-bit ASCII's '<', '>', '&', ';', '/', '=', + * "'", '"', 'a' - 'z', 'A' - 'Z', and the whitespace characters ' ', tab, + * carriage-return, newline, and form-feed. + * + * In practice, this includes almost every single-byte encoding as well as + * UTF-8. Notably, however, it does not include UTF-16. If providing input + * that's incompatible, then convert the encoding beforehand. + * * @since 6.2.0 * @since 6.2.1 Fix: Support for various invalid comments; attribute updates are case-insensitive. * @since 6.3.2 Fix: Skip HTML-like content inside rawtext elements such as STYLE. + * @since 6.5.0 Pauses processor when input ends in an incomplete syntax token. + * Introduces "special" elements which act like void elements, e.g. TITLE, STYLE. + * Allows scanning through all tokens and processing modifiable text, where applicable. */ class WP_HTML_Tag_Processor { @@ -63489,6 +65183,49 @@ class WP_HTML_Tag_Processor * @var string */ protected $html; + /** + * Specifies mode of operation of the parser at any given time. + * + * | State | Meaning | + * | ----------------|----------------------------------------------------------------------| + * | *Ready* | The parser is ready to run. | + * | *Complete* | There is nothing left to parse. | + * | *Incomplete* | The HTML ended in the middle of a token; nothing more can be parsed. | + * | *Matched tag* | Found an HTML tag; it's possible to modify its attributes. | + * | *Text node* | Found a #text node; this is plaintext and modifiable. | + * | *CDATA node* | Found a CDATA section; this is modifiable. | + * | *Comment* | Found a comment or bogus comment; this is modifiable. | + * | *Presumptuous* | Found an empty tag closer: ``. | + * | *Funky comment* | Found a tag closer with an invalid tag name; this is modifiable. | + * + * @since 6.5.0 + * + * @see WP_HTML_Tag_Processor::STATE_READY + * @see WP_HTML_Tag_Processor::STATE_COMPLETE + * @see WP_HTML_Tag_Processor::STATE_INCOMPLETE_INPUT + * @see WP_HTML_Tag_Processor::STATE_MATCHED_TAG + * @see WP_HTML_Tag_Processor::STATE_TEXT_NODE + * @see WP_HTML_Tag_Processor::STATE_CDATA_NODE + * @see WP_HTML_Tag_Processor::STATE_COMMENT + * @see WP_HTML_Tag_Processor::STATE_DOCTYPE + * @see WP_HTML_Tag_Processor::STATE_PRESUMPTUOUS_TAG + * @see WP_HTML_Tag_Processor::STATE_FUNKY_COMMENT + * + * @var string + */ + protected $parser_state = self::STATE_READY; + /** + * What kind of syntax token became an HTML comment. + * + * Since there are many ways in which HTML syntax can create an HTML comment, + * this indicates which of those caused it. This allows the Tag Processor to + * represent more from the original input document than would appear in the DOM. + * + * @since 6.5.0 + * + * @var string|null + */ + protected $comment_type = \null; /** * Tracks a semantic location in the original HTML which * shifts with updates as they are applied to the document. @@ -63530,9 +65267,9 @@ class WP_HTML_Tag_Processor * * // Replace an attribute stored with a new value, indices * // sourced from the lazily-parsed HTML recognizer. - * $start = $attributes['src']->start; - * $end = $attributes['src']->end; - * $modifications[] = new WP_HTML_Text_Replacement( $start, $end, $new_value ); + * $start = $attributes['src']->start; + * $length = $attributes['src']->length; + * $modifications[] = new WP_HTML_Text_Replacement( $start, $length, $new_value ); * * // Correspondingly, something like this will appear in this array. * $lexical_updates = array( @@ -63566,6 +65303,7 @@ public function __construct($html) * Finds the next tag matching the $query. * * @since 6.2.0 + * @since 6.5.0 No longer processes incomplete tokens at end of document; pauses the processor at start of token. * * @param array|string|null $query { * Optional. Which tag name to find, having which class, etc. Default is to find any tag. @@ -63588,6 +65326,53 @@ public function __construct($html) public function next_tag($query = \null) { } + /** + * Finds the next token in the HTML document. + * + * An HTML document can be viewed as a stream of tokens, + * where tokens are things like HTML tags, HTML comments, + * text nodes, etc. This method finds the next token in + * the HTML document and returns whether it found one. + * + * If it starts parsing a token and reaches the end of the + * document then it will seek to the start of the last + * token and pause, returning `false` to indicate that it + * failed to find a complete token. + * + * Possible token types, based on the HTML specification: + * + * - an HTML tag, whether opening, closing, or void. + * - a text node - the plaintext inside tags. + * - an HTML comment. + * - a DOCTYPE declaration. + * - a processing instruction, e.g. ``. + * + * The Tag Processor currently only supports the tag token. + * + * @since 6.5.0 + * + * @return bool Whether a token was parsed. + */ + public function next_token() + { + } + /** + * Whether the processor paused because the input HTML document ended + * in the middle of a syntax element, such as in the middle of a tag. + * + * Example: + * + * $processor = new WP_HTML_Tag_Processor( ' + * + * + * + * Funky comments are tag closers with invalid tag names. Note + * that in HTML these are turn into bogus comments. Nonetheless, + * the Tag Processor recognizes them in a stream of HTML and + * exposes them for inspection and modification. + * + * @since 6.5.0 + * + * @access private + */ + const STATE_FUNKY_COMMENT = 'STATE_WP_FUNKY'; + /** + * Indicates that a comment was created when encountering abruptly-closed HTML comment. + * + * Example: + * + * + * + * + * @since 6.5.0 + */ + const COMMENT_AS_ABRUPTLY_CLOSED_COMMENT = 'COMMENT_AS_ABRUPTLY_CLOSED_COMMENT'; + /** + * Indicates that a comment would be parsed as a CDATA node, + * were HTML to allow CDATA nodes outside of foreign content. + * + * Example: + * + * + * + * This is an HTML comment, but it looks like a CDATA node. + * + * @since 6.5.0 + */ + const COMMENT_AS_CDATA_LOOKALIKE = 'COMMENT_AS_CDATA_LOOKALIKE'; + /** + * Indicates that a comment was created when encountering + * normative HTML comment syntax. + * + * Example: + * + * + * + * @since 6.5.0 + */ + const COMMENT_AS_HTML_COMMENT = 'COMMENT_AS_HTML_COMMENT'; + /** + * Indicates that a comment would be parsed as a Processing + * Instruction node, were they to exist within HTML. + * + * Example: + * + * + * + * This is an HTML comment, but it looks like a CDATA node. + * + * @since 6.5.0 + */ + const COMMENT_AS_PI_NODE_LOOKALIKE = 'COMMENT_AS_PI_NODE_LOOKALIKE'; + /** + * Indicates that a comment was created when encountering invalid + * HTML input, a so-called "bogus comment." + * + * Example: + * + * + * + * + * @since 6.5.0 + */ + const COMMENT_AS_INVALID_HTML = 'COMMENT_AS_INVALID_HTML'; } /** * HTML API: WP_HTML_Processor class @@ -64024,12 +66089,20 @@ public function get_updated_html() * * The following list specifies the HTML tags that _are_ supported: * + * - Containers: ADDRESS, BLOCKQUOTE, DETAILS, DIALOG, DIV, FOOTER, HEADER, MAIN, MENU, SPAN, SUMMARY. + * - Custom elements: All custom elements are supported. :) + * - Form elements: BUTTON, DATALIST, FIELDSET, INPUT, LABEL, LEGEND, METER, PROGRESS, SEARCH. + * - Formatting elements: B, BIG, CODE, EM, FONT, I, PRE, SMALL, STRIKE, STRONG, TT, U, WBR. + * - Heading elements: H1, H2, H3, H4, H5, H6, HGROUP. * - Links: A. - * - The formatting elements: B, BIG, CODE, EM, FONT, I, SMALL, STRIKE, STRONG, TT, U. - * - Containers: DIV, FIGCAPTION, FIGURE, SPAN. - * - Form elements: BUTTON. - * - Paragraph: P. - * - Void elements: IMG. + * - Lists: DD, DL, DT, LI, OL, UL. + * - Media elements: AUDIO, CANVAS, EMBED, FIGCAPTION, FIGURE, IMG, MAP, PICTURE, SOURCE, TRACK, VIDEO. + * - Paragraph: BR, P. + * - Phrasing elements: ABBR, AREA, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR. + * - Sectioning elements: ARTICLE, ASIDE, HR, NAV, SECTION. + * - Templating elements: SLOT. + * - Text decoration: RUBY. + * - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, KEYGEN, LISTING, MULTICOL, NEXTID, PARAM, SPACER. * * ### Supported markup * @@ -64066,16 +66139,6 @@ class WP_HTML_Processor extends \WP_HTML_Tag_Processor * @var int */ const MAX_BOOKMARKS = 100; - /** - * Static query for instructing the Tag Processor to visit every token. - * - * @access private - * - * @since 6.4.0 - * - * @var array - */ - const VISIT_EVERYTHING = array('tag_closers' => 'visit'); /* * Public Interface Functions */ @@ -64159,7 +66222,7 @@ public function get_last_error() /** * Finds the next tag matching the $query. * - * @TODO: Support matching the class name and tag name. + * @todo Support matching the class name and tag name. * * @since 6.4.0 * @@ -64187,6 +66250,23 @@ public function get_last_error() public function next_tag($query = \null) { } + /** + * Ensures internal accounting is maintained for HTML semantic rules while + * the underlying Tag Processor class is seeking to a bookmark. + * + * This doesn't currently have a way to represent non-tags and doesn't process + * semantic rules for text nodes. For access to the raw tokens consider using + * WP_HTML_Tag_Processor instead. + * + * @since 6.5.0 Added for internal support; do not use. + * + * @access private + * + * @return bool + */ + public function next_token() + { + } /** * Indicates if the currently-matched tag matches the given breadcrumbs. * @@ -64237,9 +66317,9 @@ public function step($node_to_process = self::PROCESS_NEXT_NODE) * Breadcrumbs start at the outermost parent and descend toward the matched element. * They always include the entire path from the root HTML node to the matched element. * - * @TODO: It could be more efficient to expose a generator-based version of this function - * to avoid creating the array copy on tag iteration. If this is done, it would likely - * be more useful to walk up the stack when yielding instead of starting at the top. + * @todo It could be more efficient to expose a generator-based version of this function + * to avoid creating the array copy on tag iteration. If this is done, it would likely + * be more useful to walk up the stack when yielding instead of starting at the top. * * Example * @@ -64298,6 +66378,10 @@ public function release_bookmark($bookmark_name) /** * Moves the internal cursor in the HTML Processor to a given bookmark's location. * + * Be careful! Seeking backwards to a previous location resets the parser to the + * start of the document and reparses the entire contents up until it finds the + * sought-after bookmarked location. + * * In order to prevent accidental infinite loops, there's a * maximum limit on the number of times seek() can be called. * @@ -64394,6 +66478,17 @@ public function seek($bookmark_name) public function set_bookmark($bookmark_name) { } + /** + * Checks whether a bookmark with the given name exists. + * + * @since 6.5.0 + * + * @param string $bookmark_name Name to identify a bookmark that potentially exists. + * @return bool Whether that bookmark exists. + */ + public function has_bookmark($bookmark_name) + { + } /* * HTML Specification Helpers */ @@ -64444,6 +66539,14 @@ public static function is_void($tag_name) * @var string */ const REPROCESS_CURRENT_NODE = 'reprocess-current-node'; + /** + * Indicates that the current HTML token should be processed without advancing the parser. + * + * @since 6.5.0 + * + * @var string + */ + const PROCESS_CURRENT_NODE = 'process-current-node'; /** * Indicates that the parser encountered unsupported markup and has bailed. * @@ -64492,6 +66595,7 @@ public static function is_void($tag_name) * * @access private * @since 6.2.0 + * @since 6.5.0 Replaced `end` with `length` to more closely align with `substr()`. * * @see WP_HTML_Tag_Processor */ @@ -64501,25 +66605,27 @@ class WP_HTML_Span * Byte offset into document where span begins. * * @since 6.2.0 + * * @var int */ public $start; /** - * Byte offset into document where span ends. + * Byte length of this span. + * + * @since 6.5.0 * - * @since 6.2.0 * @var int */ - public $end; + public $length; /** * Constructor. * * @since 6.2.0 * - * @param int $start Byte offset into document where replacement span begins. - * @param int $end Byte offset into document where replacement span ends. + * @param int $start Byte offset into document where replacement span begins. + * @param int $length Byte length of span. */ - public function __construct($start, $end) + public function __construct($start, $length) { } } @@ -64538,6 +66644,7 @@ public function __construct($start, $end) * * @access private * @since 6.2.0 + * @since 6.5.0 Replace `end` with `length` to more closely match `substr()`. * * @see WP_HTML_Tag_Processor */ @@ -64547,20 +66654,23 @@ class WP_HTML_Text_Replacement * Byte offset into document where replacement span begins. * * @since 6.2.0 + * * @var int */ public $start; /** - * Byte offset into document where replacement span ends. + * Byte length of span being replaced. + * + * @since 6.5.0 * - * @since 6.2.0 * @var int */ - public $end; + public $length; /** * Span of text to insert in document to replace existing content from start to end. * * @since 6.2.0 + * * @var string */ public $text; @@ -64569,11 +66679,11 @@ class WP_HTML_Text_Replacement * * @since 6.2.0 * - * @param int $start Byte offset into document where replacement span begins. - * @param int $end Byte offset into document where replacement span ends. - * @param string $text Span of text to insert in document to replace existing content from start to end. + * @param int $start Byte offset into document where replacement span begins. + * @param int $length Byte length of span in document being replaced. + * @param string $text Span of text to insert in document to replace existing content from start to end. */ - public function __construct($start, $end, $text) + public function __construct($start, $length, $text) { } } @@ -64700,6 +66810,767 @@ public function __wakeup() class WP_HTML_Unsupported_Exception extends \Exception { } + /** + * Interactivity API: WP_Interactivity_API_Directives_Processor class. + * + * @package WordPress + * @subpackage Interactivity API + * @since 6.5.0 + */ + /** + * Class used to iterate over the tags of an HTML string and help process the + * directive attributes. + * + * @since 6.5.0 + * + * @access private + */ + final class WP_Interactivity_API_Directives_Processor extends \WP_HTML_Tag_Processor + { + /** + * List of tags whose closer tag is not visited by the WP_HTML_Tag_Processor. + * + * @since 6.5.0 + * @var string[] + */ + const TAGS_THAT_DONT_VISIT_CLOSER_TAG = array('SCRIPT', 'IFRAME', 'NOEMBED', 'NOFRAMES', 'STYLE', 'TEXTAREA', 'TITLE', 'XMP'); + /** + * Returns the content between two balanced template tags. + * + * It positions the cursor in the closer tag of the balanced template tag, + * if it exists. + * + * @since 6.5.0 + * + * @access private + * + * @return string|null The content between the current opener template tag and its matching closer tag or null if it + * doesn't find the matching closing tag or the current tag is not a template opener tag. + */ + public function get_content_between_balanced_template_tags() + { + } + /** + * Sets the content between two balanced tags. + * + * @since 6.5.0 + * + * @access private + * + * @param string $new_content The string to replace the content between the matching tags. + * @return bool Whether the content was successfully replaced. + */ + public function set_content_between_balanced_tags(string $new_content) : bool + { + } + /** + * Appends content after the closing tag of a template tag. + * + * It positions the cursor in the closer tag of the balanced template tag, + * if it exists. + * + * @access private + * + * @param string $new_content The string to append after the closing template tag. + * @return bool Whether the content was successfully appended. + */ + public function append_content_after_template_tag_closer(string $new_content) : bool + { + } + /** + * Skips processing the content between tags. + * + * It positions the cursor in the closer tag of the foreign element, if it + * exists. + * + * This function is intended to skip processing SVG and MathML inner content + * instead of bailing out the whole processing. + * + * @since 6.5.0 + * + * @access private + * + * @return bool Whether the foreign content was successfully skipped. + */ + public function skip_to_tag_closer() : bool + { + } + /** + * Finds the matching closing tag for an opening tag. + * + * When called while the processor is on an open tag, it traverses the HTML + * until it finds the matching closer tag, respecting any in-between content, + * including nested tags of the same name. Returns false when called on a + * closer tag, a tag that doesn't have a closer tag (void), a tag that + * doesn't visit the closer tag, or if no matching closing tag was found. + * + * @since 6.5.0 + * + * @access private + * + * @return bool Whether a matching closing tag was found. + */ + public function next_balanced_tag_closer_tag() : bool + { + } + /** + * Checks whether the current tag has and will visit its matching closer tag. + * + * @since 6.5.0 + * + * @access private + * + * @return bool Whether the current tag has a closer tag. + */ + public function has_and_visits_its_closer_tag() : bool + { + } + } + /** + * Interactivity API: WP_Interactivity_API class. + * + * @package WordPress + * @subpackage Interactivity API + * @since 6.5.0 + */ + /** + * Class used to process the Interactivity API on the server. + * + * @since 6.5.0 + */ + final class WP_Interactivity_API + { + /** + * Gets and/or sets the initial state of an Interactivity API store for a + * given namespace. + * + * If state for that store namespace already exists, it merges the new + * provided state with the existing one. + * + * @since 6.5.0 + * + * @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 + * 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 + { + } + /** + * Gets and/or sets the configuration of the Interactivity API for a given + * store namespace. + * + * If configuration for that store namespace exists, it merges the new + * provided configuration with the existing one. + * + * @since 6.5.0 + * + * @param string $store_namespace The unique store namespace identifier. + * @param array $config Optional. The array that will be merged with the existing configuration for the + * specified store namespace. + * @return array The configuration for the specified store namespace. This will be the updated configuration if a + * $config argument was provided. + */ + public function config(string $store_namespace, array $config = array()) : array + { + } + /** + * Prints the serialized client-side interactivity data. + * + * Encodes the config and initial state into JSON and prints them inside a + * script tag of type "application/json". Once in the browser, the state will + * be parsed and used to hydrate the client-side interactivity stores and the + * configuration will be available using a `getConfig` utility. + * + * @since 6.5.0 + * @phpstan-return void + */ + public function print_client_interactivity_data() + { + } + /** + * Registers the `@wordpress/interactivity` script modules. + * + * @since 6.5.0 + */ + public function register_script_modules() + { + } + /** + * Adds the necessary hooks for the Interactivity API. + * + * @since 6.5.0 + */ + public function add_hooks() + { + } + /** + * Processes the interactivity directives contained within the HTML content + * and updates the markup accordingly. + * + * @since 6.5.0 + * + * @param string $html The HTML content to process. + * @return string The processed HTML content. It returns the original content when the HTML contains unbalanced tags. + */ + public function process_directives(string $html) : string + { + } + /** + * Outputs the markup for the top loading indicator and the screen reader + * notifications during client-side navigations. + * + * This method prints a div element representing a loading bar visible during + * navigation, as well as an aria-live region that can be read by screen + * readers to announce navigation status. + * + * @since 6.5.0 + */ + public function print_router_loading_and_screen_reader_markup() + { + } + } + /** + * I18N: WP_Translation_Controller class. + * + * @package WordPress + * @subpackage I18N + * @since 6.5.0 + */ + /** + * Class WP_Translation_Controller. + * + * @since 6.5.0 + */ + final class WP_Translation_Controller + { + /** + * Utility method to retrieve the main instance of the class. + * + * The instance will be created if it does not exist yet. + * + * @since 6.5.0 + * + * @return WP_Translation_Controller + */ + public static function get_instance() : \WP_Translation_Controller + { + } + /** + * Returns the current locale. + * + * @since 6.5.0 + * + * @return string Locale. + */ + public function get_locale() : string + { + } + /** + * Sets the current locale. + * + * @since 6.5.0 + * + * @param string $locale Locale. + */ + public function set_locale(string $locale) + { + } + /** + * Loads a translation file for a given text domain. + * + * @since 6.5.0 + * + * @param string $translation_file Translation file. + * @param string $textdomain Optional. Text domain. Default 'default'. + * @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 + { + } + /** + * Unloads a translation file for a given text domain. + * + * @since 6.5.0 + * + * @param WP_Translation_File|string $file Translation file instance or file name. + * @param string $textdomain Optional. Text domain. Default 'default'. + * @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 + { + } + /** + * Unloads all translation files for a given text domain. + * + * @since 6.5.0 + * + * @param string $textdomain Optional. Text domain. Default 'default'. + * @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 + { + } + /** + * Determines whether translations are loaded for a given text domain. + * + * @since 6.5.0 + * + * @param string $textdomain Optional. Text domain. Default 'default'. + * @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 + { + } + /** + * Translates a singular string. + * + * @since 6.5.0 + * + * @param string $text Text to translate. + * @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. + * @return string|false Translation on success, false otherwise. + */ + public function translate(string $text, string $context = '', string $textdomain = 'default', string $locale = \null) + { + } + /** + * Translates plurals. + * + * Checks both singular+plural combinations as well as just singulars, + * in case the translation file does not store the plural. + * + * @since 6.5.0 + * + * @param array{0: string, 1: string} $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. + * @return string|false Translation on success, false otherwise. + * @phpstan-param array{0: string, 1: string}{ + * 0: string, + * 1: string, + * } $plurals + */ + public function translate_plural(array $plurals, int $number, string $context = '', string $textdomain = 'default', string $locale = \null) + { + } + /** + * Returns all existing headers for a given text domain. + * + * @since 6.5.0 + * + * @param string $textdomain Optional. Text domain. Default 'default'. + * @return array Headers. + */ + public function get_headers(string $textdomain = 'default') : array + { + } + /** + * Returns all entries for a given text domain. + * + * @since 6.5.0 + * + * @param string $textdomain Optional. Text domain. Default 'default'. + * @return array Entries. + */ + public function get_entries(string $textdomain = 'default') : array + { + } + } + /** + * I18N: WP_Translation_File class. + * + * @package WordPress + * @subpackage I18N + * @since 6.5.0 + */ + /** + * Class WP_Translation_File. + * + * @since 6.5.0 + */ + abstract class WP_Translation_File + { + /** + * List of headers. + * + * @since 6.5.0 + * @var array + */ + protected $headers = array(); + /** + * Whether file has been parsed. + * + * @since 6.5.0 + * @var bool + */ + protected $parsed = \false; + /** + * Error information. + * + * @since 6.5.0 + * @var string|null Error message or null if no error. + */ + protected $error; + /** + * File name. + * + * @since 6.5.0 + * @var string + */ + protected $file = ''; + /** + * Translation entries. + * + * @since 6.5.0 + * @var array + */ + protected $entries = array(); + /** + * Plural forms function. + * + * @since 6.5.0 + * @var callable|null Plural forms. + */ + protected $plural_forms = \null; + /** + * Constructor. + * + * @since 6.5.0 + * + * @param string $file File to load. + */ + protected function __construct(string $file) + { + } + /** + * Creates a new WP_Translation_File instance for a given file. + * + * @since 6.5.0 + * + * @param string $file File name. + * @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) + { + } + /** + * Creates a new WP_Translation_File instance for a given file. + * + * @since 6.5.0 + * + * @param string $file Source file name. + * @param string $filetype Desired target file type. + * @return string|false Transformed translation file contents on success, false otherwise. + */ + public static function transform(string $file, string $filetype) + { + } + /** + * Returns all headers. + * + * @since 6.5.0 + * + * @return array Headers. + */ + public function headers() : array + { + } + /** + * Returns all entries. + * + * @since 6.5.0 + * + * @return array Entries. + */ + public function entries() : array + { + } + /** + * Returns the current error information. + * + * @since 6.5.0 + * + * @return string|null Error message or null if no error. + */ + public function error() + { + } + /** + * Returns the file name. + * + * @since 6.5.0 + * + * @return string File name. + */ + public function get_file() : string + { + } + /** + * Translates a given string. + * + * @since 6.5.0 + * + * @param string $text String to translate. + * @return false|string Translation(s) on success, false otherwise. + */ + public function translate(string $text) + { + } + /** + * Returns the plural form for a given number. + * + * @since 6.5.0 + * + * @param int $number Count. + * @return int Plural form. + */ + public function get_plural_form(int $number) : int + { + } + /** + * Returns the plural forms expression as a tuple. + * + * @since 6.5.0 + * + * @param string $header Plural-Forms header string. + * @return string Plural forms expression. + */ + protected function get_plural_expression_from_header(string $header) : string + { + } + /** + * Makes a function, which will return the right translation index, according to the + * plural forms header. + * + * @since 6.5.0 + * + * @param string $expression Plural form expression. + * @return callable(int $num): int Plural forms function. + */ + protected function make_plural_form_function(string $expression) : callable + { + } + /** + * Imports translations from another file. + * + * @since 6.5.0 + * + * @param WP_Translation_File $source Source file. + * @return bool True on success, false otherwise. + */ + protected function import(\WP_Translation_File $source) : bool + { + } + /** + * Parses the file. + * + * @since 6.5.0 + */ + protected abstract function parse_file(); + /** + * Exports translation contents as a string. + * + * @since 6.5.0 + * + * @return string Translation file contents. + */ + public abstract function export(); + } + /** + * I18N: WP_Translation_File_MO class. + * + * @package WordPress + * @subpackage I18N + * @since 6.5.0 + */ + /** + * Class WP_Translation_File_MO. + * + * @since 6.5.0 + */ + class WP_Translation_File_MO extends \WP_Translation_File + { + /** + * Endian value. + * + * V for little endian, N for big endian, or false. + * + * Used for unpack(). + * + * @since 6.5.0 + * @var false|'V'|'N' + */ + protected $uint32 = \false; + /** + * The magic number of the GNU message catalog format. + * + * @since 6.5.0 + * @var int + */ + const MAGIC_MARKER = 0x950412de; + /** + * Detects endian and validates file. + * + * @since 6.5.0 + * + * @param string $header File contents. + * @return false|'V'|'N' V for little endian, N for big endian, or false on failure. + */ + protected function detect_endian_and_validate_file(string $header) + { + } + /** + * Parses the file. + * + * @since 6.5.0 + * + * @return bool True on success, false otherwise. + */ + protected function parse_file() : bool + { + } + /** + * Exports translation contents as a string. + * + * @since 6.5.0 + * + * @return string Translation file contents. + */ + public function export() : string + { + } + } + /** + * I18N: WP_Translation_File_PHP class. + * + * @package WordPress + * @subpackage I18N + * @since 6.5.0 + */ + /** + * Class WP_Translation_File_PHP. + * + * @since 6.5.0 + */ + class WP_Translation_File_PHP extends \WP_Translation_File + { + /** + * Parses the file. + * + * @since 6.5.0 + * @phpstan-return void + */ + protected function parse_file() + { + } + /** + * Exports translation contents as a string. + * + * @since 6.5.0 + * + * @return string Translation file contents. + */ + public function export() : string + { + } + } + /** + * I18N: WP_Translations class. + * + * @package WordPress + * @subpackage I18N + * @since 6.5.0 + */ + /** + * Class WP_Translations. + * + * @since 6.5.0 + * + * @property-read array $headers + * @property-read array $entries + */ + class WP_Translations + { + /** + * Text domain. + * + * @since 6.5.0 + * @var string + */ + protected $textdomain = 'default'; + /** + * Translation controller instance. + * + * @since 6.5.0 + * @var WP_Translation_Controller + */ + protected $controller; + /** + * Constructor. + * + * @since 6.5.0 + * + * @param WP_Translation_Controller $controller I18N controller. + * @param string $textdomain Optional. Text domain. Default 'default'. + */ + public function __construct(\WP_Translation_Controller $controller, string $textdomain = 'default') + { + } + /** + * Magic getter for backward compatibility. + * + * @since 6.5.0 + * + * @param string $name Property name. + * @return mixed + */ + public function __get(string $name) + { + } + /** + * Translates a plural string. + * + * @since 6.5.0 + * + * @param string|null $singular Singular string. + * @param string|null $plural Plural string. + * @param int|float $count Count. Should be an integer, but some plugins pass floats. + * @param string|null $context Context. + * @return string|null Translation if it exists, or the unchanged singular string. + */ + public function translate_plural($singular, $plural, $count = 1, $context = '') + { + } + /** + * Translates a singular string. + * + * @since 6.5.0 + * + * @param string|null $singular Singular string. + * @param string|null $context Context. + * @return string|null Translation if it exists, or the unchanged singular string + */ + public function translate($singular, $context = '') + { + } + } class wp_atom_server { public function __call($name, $arguments) @@ -64711,6 +67582,8 @@ public static function __callStatic($name, $arguments) } /** * Translation_Entry class encapsulates a translatable string. + * + * @since 2.8.0 */ #[\AllowDynamicProperties] class Translation_Entry @@ -64765,6 +67638,7 @@ public function __construct($args = array()) /** * PHP4 constructor. * + * @since 2.8.0 * @deprecated 5.4.0 Use __construct() instead. * * @see Translation_Entry::__construct() @@ -64775,35 +67649,66 @@ public function Translation_Entry($args = array()) /** * Generates a unique key for this entry. * + * @since 2.8.0 + * * @return string|false The key or false if the entry is null. */ public function key() { } /** - * @param object $other + * Merges another translation entry with the current one. + * + * @since 2.8.0 + * + * @param Translation_Entry $other Other translation entry. */ public function merge_with(&$other) { } } + /** + * Translations class. + * + * @since 2.8.0 + */ #[\AllowDynamicProperties] class Translations { + /** + * List of translation entries. + * + * @since 2.8.0 + * + * @var Translation_Entry[] + */ public $entries = array(); + /** + * List of translation headers. + * + * @since 2.8.0 + * + * @var array + */ public $headers = array(); /** - * Add entry to the PO structure + * Adds an entry to the PO structure. + * + * @since 2.8.0 * * @param array|Translation_Entry $entry - * @return bool true on success, false if the entry doesn't have a key + * @return bool True on success, false if the entry doesn't have a key. */ public function add_entry($entry) { } /** + * Adds or merges an entry to the PO structure. + * + * @since 2.8.0 + * * @param array|Translation_Entry $entry - * @return bool + * @return bool True on success, false if the entry doesn't have a key. */ public function add_entry_or_merge($entry) { @@ -64815,6 +67720,8 @@ public function add_entry_or_merge($entry) * * TODO: this should be out of this class, it is gettext specific * + * @since 2.8.0 + * * @param string $header header name, without trailing : * @param string $value header value, without trailing \n */ @@ -64822,24 +67729,42 @@ public function set_header($header, $value) { } /** - * @param array $headers + * Sets translation headers. + * + * @since 2.8.0 + * + * @param array $headers Associative array of headers. */ public function set_headers($headers) { } /** + * Returns a given translation header. + * + * @since 2.8.0 + * * @param string $header + * @return string|false Header if it exists, false otherwise. */ public function get_header($header) { } /** - * @param Translation_Entry $entry + * Returns a given translation entry. + * + * @since 2.8.0 + * + * @param Translation_Entry $entry Translation entry. + * @return Translation_Entry|false Translation entry if it exists, false otherwise. */ public function translate_entry(&$entry) { } /** + * Translates a singular string. + * + * @since 2.8.0 + * * @param string $singular * @param string $context * @return string @@ -64856,86 +67781,128 @@ public function translate($singular, $context = \null) * This function should be overridden by the subclasses. For example MO/PO can derive the logic * from their headers. * - * @param int $count number of items + * @since 2.8.0 + * + * @param int $count Number of items. + * @return int Plural form to use. */ public function select_plural_form($count) { } /** - * @return int + * Returns the plural forms count. + * + * @since 2.8.0 + * + * @return int Plural forms count. */ public function get_plural_forms_count() { } /** + * Translates a plural string. + * + * @since 2.8.0 + * * @param string $singular * @param string $plural * @param int $count * @param string $context + * @return string */ public function translate_plural($singular, $plural, $count, $context = \null) { } /** - * Merge $other in the current object. + * Merges other translations into the current one. * - * @param Object $other Another Translation object, whose translations will be merged in this one (passed by reference). + * @since 2.8.0 + * + * @param Translations $other Another Translation object, whose translations will be merged in this one (passed by reference). */ public function merge_with(&$other) { } /** - * @param object $other + * Merges originals with existing entries. + * + * @since 2.8.0 + * + * @param Translations $other */ public function merge_originals_with(&$other) { } } + /** + * Gettext_Translations class. + * + * @since 2.8.0 + */ class Gettext_Translations extends \Translations { /** * Number of plural forms. * * @var int + * + * @since 2.8.0 */ public $_nplurals; /** * Callback to retrieve the plural form. * * @var callable + * + * @since 2.8.0 */ public $_gettext_select_plural_form; /** * The gettext implementation of select_plural_form. * - * It lives in this class, because there are more than one descendand, which will use it and + * It lives in this class, because there are more than one descendant, which will use it and * they can't share it effectively. * - * @param int $count + * @since 2.8.0 + * + * @param int $count Plural forms count. + * @return int Plural form to use. */ public function gettext_select_plural_form($count) { } /** + * Returns the nplurals and plural forms expression from the Plural-Forms header. + * + * @since 2.8.0 + * * @param string $header - * @return array + * @return array{0: int, 1: string} */ public function nplurals_and_expression_from_header($header) { } /** * Makes a function, which will return the right translation index, according to the - * plural forms header + * plural forms header. + * + * @since 2.8.0 * * @param int $nplurals * @param string $expression + * @return callable */ public function make_plural_form_function($nplurals, $expression) { } /** * Adds parentheses to the inner parts of ternary operators in - * plural expressions, because PHP evaluates ternary oerators from left to right + * plural expressions, because PHP evaluates ternary operators from left to right + * + * @since 2.8.0 + * @deprecated 6.5.0 Use the Plural_Forms class instead. + * + * @see Plural_Forms * * @param string $expression the expression without parentheses * @return string the expression with parentheses added @@ -64944,13 +67911,21 @@ public function parenthesize_plural_exression($expression) { } /** + * Prepare translation headers. + * + * @since 2.8.0 + * * @param string $translation - * @return array + * @return array Translation headers */ public function make_headers($translation) { } /** + * Sets translation headers. + * + * @since 2.8.0 + * * @param string $header * @param string $value */ @@ -65181,7 +68156,7 @@ public function export_headers() /** * Exports all entries to PO format * - * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end + * @return string sequence of msgid/msgstr PO strings, doesn't contain a newline at the end */ public function export_entries() { @@ -65190,7 +68165,7 @@ public function export_entries() * Exports the whole PO file as a string * * @param bool $include_headers whether to include the headers in the export - * @return string ready for inclusion in PO file string for headers and all the enrtries + * @return string ready for inclusion in PO file string for headers and all the entries */ public function export($include_headers = \true) { @@ -65228,7 +68203,7 @@ public static function poify($input_string) * Gives back the original string from a PO-formatted string * * @param string $input_string PO-formatted string - * @return string enascaped string + * @return string unescaped string */ public static function unpoify($input_string) { @@ -65566,17 +68541,37 @@ public function POMO_CachedIntFileReader($filename) } } /** - * Provides the same interface as Translations, but doesn't do anything + * Provides the same interface as Translations, but doesn't do anything. + * + * @since 2.8.0 */ #[\AllowDynamicProperties] class NOOP_Translations { + /** + * List of translation entries. + * + * @since 2.8.0 + * + * @var Translation_Entry[] + */ public $entries = array(); + /** + * List of translation headers. + * + * @since 2.8.0 + * + * @var array + */ public $headers = array(); public function add_entry($entry) { } /** + * Sets a translation header. + * + * @since 2.8.0 + * * @param string $header * @param string $value */ @@ -65584,12 +68579,20 @@ public function set_header($header, $value) { } /** + * Sets translation headers. + * + * @since 2.8.0 + * * @param array $headers */ public function set_headers($headers) { } /** + * Returns a translation header. + * + * @since 2.8.0 + * * @param string $header * @return false */ @@ -65597,6 +68600,10 @@ public function get_header($header) { } /** + * Returns a given translation entry. + * + * @since 2.8.0 + * * @param Translation_Entry $entry * @return false */ @@ -65604,6 +68611,10 @@ public function translate_entry(&$entry) { } /** + * Translates a singular string. + * + * @since 2.8.0 + * * @param string $singular * @param string $context */ @@ -65611,29 +68622,46 @@ public function translate($singular, $context = \null) { } /** + * Returns the plural form to use. + * + * @since 2.8.0 + * * @param int $count - * @return bool + * @return int */ public function select_plural_form($count) { } /** + * Returns the plural forms count. + * + * @since 2.8.0 + * * @return int */ public function get_plural_forms_count() { } /** + * Translates a plural string. + * + * @since 2.8.0 + * * @param string $singular * @param string $plural * @param int $count * @param string $context + * @return string */ public function translate_plural($singular, $plural, $count, $context = \null) { } /** - * @param object $other + * Merges other translations into the current one. + * + * @since 2.8.0 + * + * @param Translations $other */ public function merge_with(&$other) { @@ -66523,6 +69551,13 @@ class WP_REST_Server * @var array */ protected $embed_cache = array(); + /** + * Stores request objects that are currently being handled. + * + * @since 6.5.0 + * @var array + */ + protected $dispatching_requests = array(); /** * Instantiates the REST server. * @@ -66767,6 +69802,18 @@ public function get_route_options($route) public function dispatch($request) { } + /** + * Returns whether the REST server is currently dispatching / responding to a request. + * + * This may be a standalone REST API request, or an internal request dispatched from within a regular page load. + * + * @since 6.5.0 + * + * @return bool Whether the REST server is currently handling a request. + */ + public function is_dispatching() + { + } /** * Matches a request object to its handler. * @@ -68033,6 +71080,8 @@ protected function check_delete_permission($post) * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * + * @global WP_Post $post Global post object. + * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. @@ -68203,6 +71252,18 @@ public function create_item($request) protected function insert_attachment($request) { } + /** + * Determines the featured media based on a request param. + * + * @since 6.5.0 + * + * @param int $featured_media Featured Media ID. + * @param int $post_id Post ID. + * @return bool|WP_Error Whether the post thumbnail was successfully deleted, otherwise WP_Error. + */ + protected function handle_featured_media($featured_media, $post_id) + { + } /** * Updates a single attachment. * @@ -68496,6 +71557,7 @@ public function get_item_permissions_check($request) * Retrieves one revision from the collection. * * @since 4.7.0 + * @since 6.5.0 Added a condition to check that parent id matches revision parent id. * * @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. @@ -68544,6 +71606,8 @@ protected function prepare_items_query($prepared_args = array(), $request = \nul * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * + * @global WP_Post $post Global post object. + * * @param WP_Post $item Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. @@ -69229,6 +72293,7 @@ public function get_item($request) * @since 5.5.0 * @since 5.9.0 Renamed `$block_type` to `$item` to match parent class for PHP 8 named parameter support. * @since 6.3.0 Added `selectors` field. + * @since 6.5.0 Added `view_script_module_ids` field. * * @param WP_Block_Type $item Block type data. * @param WP_REST_Request $request Full details about the request. @@ -69696,6 +72761,584 @@ public function export() { } } + /** + * Rest Font Collections Controller. + * + * This file contains the class for the REST API Font Collections Controller. + * + * @package WordPress + * @subpackage REST_API + * @since 6.5.0 + */ + /** + * Font Library Controller class. + * + * @since 6.5.0 + */ + class WP_REST_Font_Collections_Controller extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 6.5.0 + */ + public function __construct() + { + } + /** + * Registers the routes for the objects of the controller. + * + * @since 6.5.0 + */ + public function register_routes() + { + } + /** + * Gets the font collections available. + * + * @since 6.5.0 + * + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + */ + public function get_items($request) + { + } + /** + * Gets a font 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) + { + } + /** + * Prepare a single collection output for response. + * + * @since 6.5.0 + * + * @param WP_Font_Collection $item Font collection object. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + */ + public function prepare_item_for_response($item, $request) + { + } + /** + * Retrieves the font collection's schema, conforming to JSON Schema. + * + * @since 6.5.0 + * + * @return array Item schema data. + */ + public function get_item_schema() + { + } + /** + * Prepares links for the request. + * + * @since 6.5.0 + * + * @param WP_Font_Collection $collection Font collection data + * @return array Links for the given font collection. + */ + protected function prepare_links($collection) + { + } + /** + * Retrieves the search params for the font collections. + * + * @since 6.5.0 + * + * @return array Collection parameters. + */ + public function get_collection_params() + { + } + /** + * Checks whether the user has permissions to use the Fonts Collections. + * + * @since 6.5.0 + * + * @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise. + */ + public function get_items_permissions_check($request) + { + } + } + /** + * REST API: WP_REST_Font_Faces_Controller class + * + * @package WordPress + * @subpackage REST_API + * @since 6.5.0 + */ + /** + * Class to access font faces through the REST API. + */ + class WP_REST_Font_Faces_Controller extends \WP_REST_Posts_Controller + { + /** + * The latest version of theme.json schema supported by the controller. + * + * @since 6.5.0 + * @var int + */ + const LATEST_THEME_JSON_VERSION_SUPPORTED = 2; + /** + * Whether the controller supports batching. + * + * @since 6.5.0 + * @var false + */ + protected $allow_batch = \false; + /** + * Registers the routes for posts. + * + * @since 6.5.0 + * + * @see register_rest_route() + */ + public function register_routes() + { + } + /** + * Checks if a given request has access to font faces. + * + * @since 6.5.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_items_permissions_check($request) + { + } + /** + * Checks if a given request has access to a font face. + * + * @since 6.5.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) + { + } + /** + * Validates settings when creating a font face. + * + * @since 6.5.0 + * + * @param string $value Encoded JSON string of font face settings. + * @param WP_REST_Request $request Request object. + * @return true|WP_Error True if the settings are valid, otherwise a WP_Error object. + */ + public function validate_create_font_face_settings($value, $request) + { + } + /** + * Sanitizes the font face settings when creating a font face. + * + * @since 6.5.0 + * + * @param string $value Encoded JSON string of font face settings. + * @return array Decoded and sanitized array of font face settings. + */ + public function sanitize_font_face_settings($value) + { + } + /** + * Retrieves a collection of font faces within the parent font family. + * + * @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_items($request) + { + } + /** + * Retrieves a single font face within the parent font family. + * + * @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) + { + } + /** + * Creates a font face for the parent font family. + * + * @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 create_item($request) + { + } + /** + * Deletes a single font face. + * + * @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 delete_item($request) + { + } + /** + * Prepares a single font face output for response. + * + * @since 6.5.0 + * + * @param WP_Post $item Post object. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response Response object. + */ + public function prepare_item_for_response($item, $request) + { + } + /** + * Retrieves the post's schema, conforming to JSON Schema. + * + * @since 6.5.0 + * + * @return array Item schema data. + */ + public function get_item_schema() + { + } + /** + * Retrieves the item's schema for display / public consumption purposes. + * + * @since 6.5.0 + * + * @return array Public item schema data. + */ + public function get_public_item_schema() + { + } + /** + * Retrieves the query params for the font face collection. + * + * @since 6.5.0 + * + * @return array Collection parameters. + */ + public function get_collection_params() + { + } + /** + * Get the params used when creating a new font face. + * + * @since 6.5.0 + * + * @return array Font face create arguments. + */ + public function get_create_params() + { + } + /** + * Get the parent font family, if the ID is valid. + * + * @since 6.5.0 + * + * @param int $font_family_id Supplied ID. + * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. + */ + protected function get_parent_font_family_post($font_family_id) + { + } + /** + * Prepares links for the request. + * + * @since 6.5.0 + * + * @param WP_Post $post Post object. + * @return array Links for the given post. + */ + protected function prepare_links($post) + { + } + /** + * Prepares a single font face post for creation. + * + * @since 6.5.0 + * + * @param WP_REST_Request $request Request object. + * @return stdClass Post object. + */ + protected function prepare_item_for_database($request) + { + } + /** + * Sanitizes a single src value for a font face. + * + * @since 6.5.0 + * + * @param string $value Font face src that is a URL or the key for a $_FILES array item. + * @return string Sanitized value. + */ + protected function sanitize_src($value) + { + } + /** + * Handles the upload of a font file using wp_handle_upload(). + * + * @since 6.5.0 + * + * @param array $file Single file item from $_FILES. + * @return array|WP_Error Array containing uploaded file attributes on success, or WP_Error object on failure. + */ + protected function handle_font_file_upload($file) + { + } + /** + * Handles file upload error. + * + * @since 6.5.0 + * + * @param array $file File upload data. + * @param string $message Error message from wp_handle_upload(). + * @return WP_Error WP_Error object. + */ + public function handle_font_file_upload_error($file, $message) + { + } + /** + * Returns relative path to an uploaded font file. + * + * The path is relative to the current fonts directory. + * + * @since 6.5.0 + * @access private + * + * @param string $path Full path to the file. + * @return string Relative path on success, unchanged path on failure. + */ + protected function relative_fonts_path($path) + { + } + /** + * Gets the font face's settings from the post. + * + * @since 6.5.0 + * + * @param WP_Post $post Font face post object. + * @return array Font face settings array. + */ + protected function get_settings_from_post($post) + { + } + } + /** + * REST API: WP_REST_Font_Families_Controller class + * + * @package WordPress + * @subpackage REST_API + * @since 6.5.0 + */ + /** + * Font Families Controller class. + * + * @since 6.5.0 + */ + class WP_REST_Font_Families_Controller extends \WP_REST_Posts_Controller + { + /** + * The latest version of theme.json schema supported by the controller. + * + * @since 6.5.0 + * @var int + */ + const LATEST_THEME_JSON_VERSION_SUPPORTED = 2; + /** + * Whether the controller supports batching. + * + * @since 6.5.0 + * @var false + */ + protected $allow_batch = \false; + /** + * Checks if a given request has access to font families. + * + * @since 6.5.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_items_permissions_check($request) + { + } + /** + * Checks if a given request has access to a font family. + * + * @since 6.5.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) + { + } + /** + * Validates settings when creating or updating a font family. + * + * @since 6.5.0 + * + * @param string $value Encoded JSON string of font family settings. + * @param WP_REST_Request $request Request object. + * @return true|WP_Error True if the settings are valid, otherwise a WP_Error object. + */ + public function validate_font_family_settings($value, $request) + { + } + /** + * Sanitizes the font family settings when creating or updating a font family. + * + * @since 6.5.0 + * + * @param string $value Encoded JSON string of font family settings. + * @return array Decoded array of font family settings. + */ + public function sanitize_font_family_settings($value) + { + } + /** + * Creates a single font family. + * + * @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 create_item($request) + { + } + /** + * Deletes a single font family. + * + * @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 delete_item($request) + { + } + /** + * Prepares a single font family output for response. + * + * @since 6.5.0 + * + * @param WP_Post $item Post object. + * @param WP_REST_Request $request Request object. + * @return WP_REST_Response Response object. + */ + public function prepare_item_for_response($item, $request) + { + } + /** + * Retrieves the post's schema, conforming to JSON Schema. + * + * @since 6.5.0 + * + * @return array Item schema data. + */ + public function get_item_schema() + { + } + /** + * Retrieves the item's schema for display / public consumption purposes. + * + * @since 6.5.0 + * + * @return array Public item schema data. + */ + public function get_public_item_schema() + { + } + /** + * Retrieves the query params for the font family collection. + * + * @since 6.5.0 + * + * @return array Collection parameters. + */ + public function get_collection_params() + { + } + /** + * Get the arguments used when creating or updating a font family. + * + * @since 6.5.0 + * + * @return array Font family create/edit arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the child font face post IDs. + * + * @since 6.5.0 + * + * @param int $font_family_id Font family post ID. + * @return int[] Array of child font face post IDs. + */ + protected function get_font_face_ids($font_family_id) + { + } + /** + * Prepares font family links for the request. + * + * @since 6.5.0 + * + * @param WP_Post $post Post object. + * @return array Links for the given post. + */ + protected function prepare_links($post) + { + } + /** + * Prepares child font face links for the request. + * + * @param int $font_family_id Font family post ID. + * @return array Links for the child font face posts. + */ + protected function prepare_font_face_links($font_family_id) + { + } + /** + * Prepares a single font family post for create or update. + * + * @since 6.5.0 + * + * @param WP_REST_Request $request Request object. + * @return stdClass|WP_Error Post object or WP_Error. + */ + protected function prepare_item_for_database($request) + { + } + /** + * Gets the font family's settings from the post. + * + * @since 6.5.0 + * + * @param WP_Post $post Font family post object. + * @return array Font family settings array. + */ + protected function get_settings_from_post($post) + { + } + } /** * REST API: WP_REST_Global_Styles_Controller class * @@ -70005,6 +73648,7 @@ public function __construct() * Registers the controller's routes. * * @since 6.3.0 + * @since 6.5.0 Added route to fetch individual global styles revisions. */ public function register_routes() { @@ -70048,6 +73692,28 @@ 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. @@ -73028,7 +76694,7 @@ public function get_item_schema() * * @since 5.9.0 * - * @param WP_REST_REQUEST $request Full details about the request. + * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error The parsed details as a response object. WP_Error if there are errors. */ public function parse_url_details($request) @@ -74396,26 +78062,46 @@ public function __construct() { } /** - * Searches the object type content for a given search request. + * Searches the post formats for a given search request. * * @since 5.6.0 * * @param WP_REST_Request $request Full REST request. - * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing - * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the - * total count for the matching search results. + * @return array { + * Associative array containing found IDs and total count for the matching search results. + * + * @type string[] $ids Array containing slugs for the matching post formats. + * @type int $total Total count for the matching search results. + * } + * @phpstan-return array{ + * ids: string[], + * total: int, + * } */ public function search_items(\WP_REST_Request $request) { } /** - * Prepares the search result for a given ID. + * Prepares the search result for a given post format. * * @since 5.6.0 * * @param string $id Item ID, the post format slug. * @param array $fields Fields to include for the item. - * @return array Associative array containing all fields for the item. + * @return array { + * Associative array containing fields for the post format based on the `$fields` parameter. + * + * @type string $id Optional. Post format slug. + * @type string $title Optional. Post format name. + * @type string $url Optional. Post format permalink URL. + * @type string $type Optional. String 'post-format'. + *} + * @phpstan-return array{ + * id: string, + * title: string, + * url: string, + * type: string, + * } */ public function prepare_item($id, array $fields) { @@ -74457,26 +78143,46 @@ public function __construct() { } /** - * Searches the object type content for a given search request. + * Searches posts for a given search request. * * @since 5.0.0 * * @param WP_REST_Request $request Full REST request. - * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing - * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the - * total count for the matching search results. + * @return array { + * Associative array containing found IDs and total count for the matching search results. + * + * @type int[] $ids Array containing the matching post IDs. + * @type int $total Total count for the matching search results. + * } + * @phpstan-return array{ + * ids: int[], + * total: int, + * } */ public function search_items(\WP_REST_Request $request) { } /** - * Prepares the search result for a given ID. + * Prepares the search result for a given post ID. * * @since 5.0.0 * - * @param int $id Item ID. - * @param array $fields Fields to include for the item. - * @return array Associative array containing all fields for the item. + * @param int $id Post ID. + * @param array $fields Fields to include for the post. + * @return array { + * Associative array containing fields for the post based on the `$fields` parameter. + * + * @type int $id Optional. Post ID. + * @type string $title Optional. Post title. + * @type string $url Optional. Post permalink URL. + * @type string $type Optional. Post type. + * } + * @phpstan-return array{ + * id: int, + * title: string, + * url: string, + * type: string, + * } */ public function prepare_item($id, array $fields) { @@ -74545,7 +78251,7 @@ public function __construct() { } /** - * Searches the object type content for a given search request. + * Searches terms for a given search request. * * @since 5.6.0 * @@ -74553,7 +78259,7 @@ public function __construct() * @return array { * Associative array containing found IDs and total count for the matching search results. * - * @type int[] $ids Found IDs. + * @type int[] $ids Found term IDs. * @type string|int|WP_Error $total Numeric string containing the number of terms in that * taxonomy, 0 if there are no results, or WP_Error if * the requested taxonomy does not exist. @@ -74567,13 +78273,26 @@ public function search_items(\WP_REST_Request $request) { } /** - * Prepares the search result for a given ID. + * Prepares the search result for a given term ID. * * @since 5.6.0 * - * @param int $id Item ID. - * @param array $fields Fields to include for the item. - * @return array Associative array containing all fields for the item. + * @param int $id Term ID. + * @param array $fields Fields to include for the term. + * @return array { + * Associative array containing fields for the term based on the `$fields` parameter. + * + * @type int $id Optional. Term ID. + * @type string $title Optional. Term name. + * @type string $url Optional. Term permalink URL. + * @type string $type Optional. Term taxonomy name. + * } + * @phpstan-return array{ + * id: int, + * title: string, + * url: string, + * type: string, + * } */ public function prepare_item($id, array $fields) { @@ -75761,6 +79480,8 @@ public function get_css($options = array()) * @since 6.1.0 * @since 6.3.0 Added support for text-columns. * @since 6.4.0 Added support for background.backgroundImage. + * @since 6.5.0 Added support for background.backgroundPosition, + * background.backgroundRepeat and dimensions.aspectRatio. */ #[\AllowDynamicProperties] final class WP_Style_Engine @@ -75785,7 +79506,7 @@ final class WP_Style_Engine * @since 6.1.0 * @var array */ - const BLOCK_STYLE_DEFINITIONS_METADATA = array('background' => array('backgroundImage' => array('property_keys' => array('default' => 'background-image'), 'value_func' => array(self::class, 'get_url_or_value_css_declaration'), 'path' => array('background', 'backgroundImage')), 'backgroundSize' => array('property_keys' => array('default' => 'background-size'), 'path' => array('background', 'backgroundSize'))), 'color' => array('text' => array('property_keys' => array('default' => 'color'), 'path' => array('color', 'text'), 'css_vars' => array('color' => '--wp--preset--color--$slug'), 'classnames' => array('has-text-color' => \true, 'has-$slug-color' => 'color')), 'background' => array('property_keys' => array('default' => 'background-color'), 'path' => array('color', 'background'), 'css_vars' => array('color' => '--wp--preset--color--$slug'), 'classnames' => array('has-background' => \true, 'has-$slug-background-color' => 'color')), 'gradient' => array('property_keys' => array('default' => 'background'), 'path' => array('color', 'gradient'), 'css_vars' => array('gradient' => '--wp--preset--gradient--$slug'), 'classnames' => array('has-background' => \true, 'has-$slug-gradient-background' => 'gradient'))), 'border' => array('color' => array('property_keys' => array('default' => 'border-color', 'individual' => 'border-%s-color'), 'path' => array('border', 'color'), 'classnames' => array('has-border-color' => \true, 'has-$slug-border-color' => 'color')), 'radius' => array('property_keys' => array('default' => 'border-radius', 'individual' => 'border-%s-radius'), 'path' => array('border', 'radius')), 'style' => array('property_keys' => array('default' => 'border-style', 'individual' => 'border-%s-style'), 'path' => array('border', 'style')), 'width' => array('property_keys' => array('default' => 'border-width', 'individual' => 'border-%s-width'), 'path' => array('border', 'width')), 'top' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'top'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'right' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'right'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'bottom' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'bottom'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'left' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'left'), 'css_vars' => array('color' => '--wp--preset--color--$slug'))), 'shadow' => array('shadow' => array('property_keys' => array('default' => 'box-shadow'), 'path' => array('shadow'), 'css_vars' => array('shadow' => '--wp--preset--shadow--$slug'))), 'dimensions' => array('minHeight' => array('property_keys' => array('default' => 'min-height'), 'path' => array('dimensions', 'minHeight'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug'))), 'spacing' => array('padding' => array('property_keys' => array('default' => 'padding', 'individual' => 'padding-%s'), 'path' => array('spacing', 'padding'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug')), 'margin' => array('property_keys' => array('default' => 'margin', 'individual' => 'margin-%s'), 'path' => array('spacing', 'margin'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug'))), 'typography' => array('fontSize' => array('property_keys' => array('default' => 'font-size'), 'path' => array('typography', 'fontSize'), 'classnames' => array('has-$slug-font-size' => 'font-size')), 'fontFamily' => array('property_keys' => array('default' => 'font-family'), 'path' => array('typography', 'fontFamily'), 'classnames' => array('has-$slug-font-family' => 'font-family')), 'fontStyle' => array('property_keys' => array('default' => 'font-style'), 'path' => array('typography', 'fontStyle')), 'fontWeight' => array('property_keys' => array('default' => 'font-weight'), 'path' => array('typography', 'fontWeight')), 'lineHeight' => array('property_keys' => array('default' => 'line-height'), 'path' => array('typography', 'lineHeight')), 'textColumns' => array('property_keys' => array('default' => 'column-count'), 'path' => array('typography', 'textColumns')), 'textDecoration' => array('property_keys' => array('default' => 'text-decoration'), 'path' => array('typography', 'textDecoration')), 'textTransform' => array('property_keys' => array('default' => 'text-transform'), 'path' => array('typography', 'textTransform')), 'letterSpacing' => array('property_keys' => array('default' => 'letter-spacing'), 'path' => array('typography', 'letterSpacing')))); + const BLOCK_STYLE_DEFINITIONS_METADATA = array('background' => array('backgroundImage' => array('property_keys' => array('default' => 'background-image'), 'value_func' => array(self::class, 'get_url_or_value_css_declaration'), 'path' => array('background', 'backgroundImage')), 'backgroundPosition' => array('property_keys' => array('default' => 'background-position'), 'path' => array('background', 'backgroundPosition')), 'backgroundRepeat' => array('property_keys' => array('default' => 'background-repeat'), 'path' => array('background', 'backgroundRepeat')), 'backgroundSize' => array('property_keys' => array('default' => 'background-size'), 'path' => array('background', 'backgroundSize'))), 'color' => array('text' => array('property_keys' => array('default' => 'color'), 'path' => array('color', 'text'), 'css_vars' => array('color' => '--wp--preset--color--$slug'), 'classnames' => array('has-text-color' => \true, 'has-$slug-color' => 'color')), 'background' => array('property_keys' => array('default' => 'background-color'), 'path' => array('color', 'background'), 'css_vars' => array('color' => '--wp--preset--color--$slug'), 'classnames' => array('has-background' => \true, 'has-$slug-background-color' => 'color')), 'gradient' => array('property_keys' => array('default' => 'background'), 'path' => array('color', 'gradient'), 'css_vars' => array('gradient' => '--wp--preset--gradient--$slug'), 'classnames' => array('has-background' => \true, 'has-$slug-gradient-background' => 'gradient'))), 'border' => array('color' => array('property_keys' => array('default' => 'border-color', 'individual' => 'border-%s-color'), 'path' => array('border', 'color'), 'classnames' => array('has-border-color' => \true, 'has-$slug-border-color' => 'color')), 'radius' => array('property_keys' => array('default' => 'border-radius', 'individual' => 'border-%s-radius'), 'path' => array('border', 'radius')), 'style' => array('property_keys' => array('default' => 'border-style', 'individual' => 'border-%s-style'), 'path' => array('border', 'style')), 'width' => array('property_keys' => array('default' => 'border-width', 'individual' => 'border-%s-width'), 'path' => array('border', 'width')), 'top' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'top'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'right' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'right'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'bottom' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'bottom'), 'css_vars' => array('color' => '--wp--preset--color--$slug')), 'left' => array('value_func' => array(self::class, 'get_individual_property_css_declarations'), 'path' => array('border', 'left'), 'css_vars' => array('color' => '--wp--preset--color--$slug'))), 'shadow' => array('shadow' => array('property_keys' => array('default' => 'box-shadow'), 'path' => array('shadow'), 'css_vars' => array('shadow' => '--wp--preset--shadow--$slug'))), 'dimensions' => array('aspectRatio' => array('property_keys' => array('default' => 'aspect-ratio'), 'path' => array('dimensions', 'aspectRatio'), 'classnames' => array('has-aspect-ratio' => \true)), 'minHeight' => array('property_keys' => array('default' => 'min-height'), 'path' => array('dimensions', 'minHeight'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug'))), 'spacing' => array('padding' => array('property_keys' => array('default' => 'padding', 'individual' => 'padding-%s'), 'path' => array('spacing', 'padding'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug')), 'margin' => array('property_keys' => array('default' => 'margin', 'individual' => 'margin-%s'), 'path' => array('spacing', 'margin'), 'css_vars' => array('spacing' => '--wp--preset--spacing--$slug'))), 'typography' => array('fontSize' => array('property_keys' => array('default' => 'font-size'), 'path' => array('typography', 'fontSize'), 'css_vars' => array('font-size' => '--wp--preset--font-size--$slug'), 'classnames' => array('has-$slug-font-size' => 'font-size')), 'fontFamily' => array('property_keys' => array('default' => 'font-family'), 'css_vars' => array('font-family' => '--wp--preset--font-family--$slug'), 'path' => array('typography', 'fontFamily'), 'classnames' => array('has-$slug-font-family' => 'font-family')), 'fontStyle' => array('property_keys' => array('default' => 'font-style'), 'path' => array('typography', 'fontStyle')), 'fontWeight' => array('property_keys' => array('default' => 'font-weight'), 'path' => array('typography', 'fontWeight')), 'lineHeight' => array('property_keys' => array('default' => 'line-height'), 'path' => array('typography', 'lineHeight')), 'textColumns' => array('property_keys' => array('default' => 'column-count'), 'path' => array('typography', 'textColumns')), 'textDecoration' => array('property_keys' => array('default' => 'text-decoration'), 'path' => array('typography', 'textDecoration')), 'textTransform' => array('property_keys' => array('default' => 'text-transform'), 'path' => array('typography', 'textTransform')), 'letterSpacing' => array('property_keys' => array('default' => 'letter-spacing'), 'path' => array('typography', 'letterSpacing')))); /** * Stores a CSS rule using the provided CSS selector and CSS declarations. * @@ -77597,6 +81318,56 @@ public static function render_control_template_scripts() } } } +/** + * Copyright (c) 2021, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + * + * Note: this class is from libavifinfo - https://aomedia.googlesource.com/libavifinfo/+/refs/heads/main/avifinfo.php at f509487. + * It is used as a fallback to parse AVIF files when the server doesn't support AVIF, + * primarily to identify the width and height of the image. + * + * Note PHP 8.2 added native support for AVIF, so this class can be removed when WordPress requires PHP 8.2. + */ +namespace Avifinfo { + // Value was not yet parsed. + /** + * Reads an unsigned integer with most significant bits first. + * + * @param binary string $input Must be at least $num_bytes-long. + * @param int $num_bytes Number of parsed bytes. + * @return int Value. + */ + function read_big_endian($input, $num_bytes) + { + } + /** + * Reads bytes and advances the stream position by the same count. + * + * @param stream $handle Bytes will be read from this resource. + * @param int $num_bytes Number of bytes read. Must be greater than 0. + * @return binary string|false The raw bytes or false on failure. + */ + function read($handle, $num_bytes) + { + } + /** + * Advances the stream position by the given offset. + * + * @param stream $handle Bytes will be skipped from this resource. + * @param int $num_bytes Number of skipped bytes. Can be 0. + * @return bool True on success or false on failure. + */ + // Skips 'num_bytes' from the 'stream'. 'num_bytes' can be zero. + function skip($handle, $num_bytes) + { + } +} namespace { /** * Adds an action hook specific to this page. @@ -78447,6 +82218,15 @@ function wp_ajax_delete_theme() function wp_ajax_install_plugin() { } + /** + * Handles activating a plugin via AJAX. + * + * @since 6.5.0 + * @phpstan-return never + */ + function wp_ajax_activate_plugin() + { + } /** * Handles updating a plugin via AJAX. * @@ -79963,7 +83743,7 @@ function wp_nav_menu_locations_meta_box() /** * This was once used to kick-off the Core Updater. * - * Deprecated in favor of instantating a Core_Upgrader instance directly, + * Deprecated in favor of instantiating a Core_Upgrader instance directly, * and calling the 'upgrade' method. * * @since 2.7.0 @@ -79976,7 +83756,7 @@ function wp_update_core($current, $feedback = '') /** * This was once used to kick-off the Plugin Updater. * - * Deprecated in favor of instantating a Plugin_Upgrader instance directly, + * Deprecated in favor of instantiating a Plugin_Upgrader instance directly, * and calling the 'upgrade' method. * Unused since 2.8.0. * @@ -80392,7 +84172,7 @@ function wp_edit_theme_plugin_file($args) /** * Returns a filename of a temporary unique file. * - * Please note that the calling function must unlink() this itself. + * Please note that the calling function must delete or move the file. * * The filename is based off the passed parameter or defaults to the current unix timestamp, * while the directory can either be passed as well, or by leaving it blank, default to a writable @@ -80569,7 +84349,7 @@ function wp_handle_sideload(&$file, $overrides = \false, $time = \null) /** * Downloads a URL to a local temporary file using the WordPress HTTP API. * - * Please note that the calling function must unlink() the file. + * Please note that the calling function must delete or move the file. * * @since 2.5.0 * @since 5.2.0 Signature Verification with SoftFail was added. @@ -80623,6 +84403,20 @@ function verify_file_signature($filename, $signatures, $filename_for_errors = \f function wp_trusted_keys() { } + /** + * Determines whether the given file is a valid ZIP file. + * + * This function does not test to ensure that a file exists. Non-existent files + * are not valid ZIPs, so those will also return false. + * + * @since 6.4.4 + * + * @param string $file Full path to the ZIP file. + * @return bool Whether the file is a valid ZIP file. + */ + function wp_zip_file_is_valid($file) + { + } /** * Unzips a specified ZIP file to a location on the filesystem via the WordPress * Filesystem Abstraction. @@ -81139,6 +84933,19 @@ function wp_create_image_subsizes($file, $attachment_id) function _wp_make_subsizes($new_sizes, $file, $image_meta, $attachment_id) { } + /** + * Copy parent attachment properties to newly cropped image. + * + * @since 6.5.0 + * + * @param string $cropped Path to the cropped image file. + * @param int $parent_attachment_id Parent file Attachment ID. + * @param string $context Control calling the function. + * @return array Properties of attachment. + */ + function wp_copy_parent_attachment_properties($cropped, $parent_attachment_id, $context = '') + { + } /** * Generates attachment meta data and create image sub-sizes for images. * @@ -81522,7 +85329,7 @@ function media_handle_sideload($file_array, $post_id = 0, $desc = \null, $post_d * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * - * @global int $body_id + * @global string $body_id * * @param callable $content_func Function that outputs the content. * @param mixed ...$args Optional additional parameters to pass to the callback function when it's called. @@ -82383,6 +86190,7 @@ function got_mod_rewrite() * @since 3.7.0 * * @global bool $is_nginx + * @global bool $is_caddy * * @return bool Whether the server supports URL rewriting. */ @@ -83770,6 +87578,31 @@ function install_plugin_install_status($api, $loop = \false) function install_plugin_information() { } + /** + * Gets the markup for the plugin install action button. + * + * @since 6.5.0 + * + * @param string $name Plugin name. + * @param array|object $data { + * An array or object of plugin data. Can be retrieved from the API. + * + * @type string $slug The plugin slug. + * @type string[] $requires_plugins An array of plugin dependency slugs. + * @type string $version The plugin's version string. Used when getting the install status. + * } + * @param bool $compatible_php The result of a PHP compatibility check. + * @param bool $compatible_wp The result of a WP compatibility check. + * @return string $button The markup for the dependency row button. + * @phpstan-param object|array{ + * slug?: string, + * requires_plugins?: string[], + * version?: string, + * } $data + */ + function wp_get_plugin_action_button($name, $data, $compatible_php, $compatible_wp) + { + } /** * WordPress Plugin Administration API * @@ -83815,6 +87648,7 @@ function install_plugin_information() * @since 1.5.0 * @since 5.3.0 Added support for `Requires at least` and `Requires PHP` headers. * @since 5.8.0 Added support for `Update URI` header. + * @since 6.5.0 Added support for `Requires Plugins` header. * * @param string $plugin_file Absolute path to the main plugin file. * @param bool $markup Optional. If the returned data should have HTML markup applied. @@ -83823,20 +87657,21 @@ function install_plugin_information() * @return array { * Plugin data. Values will be empty if not supplied by the plugin. * - * @type string $Name Name of the plugin. Should be unique. - * @type string $PluginURI Plugin URI. - * @type string $Version Plugin version. - * @type string $Description Plugin description. - * @type string $Author Plugin author's name. - * @type string $AuthorURI Plugin author's website address (if set). - * @type string $TextDomain Plugin textdomain. - * @type string $DomainPath Plugin's relative directory path to .mo files. - * @type bool $Network Whether the plugin can only be activated network-wide. - * @type string $RequiresWP Minimum required version of WordPress. - * @type string $RequiresPHP Minimum required version of PHP. - * @type string $UpdateURI ID of the plugin for update purposes, should be a URI. - * @type string $Title Title of the plugin and link to the plugin's site (if set). - * @type string $AuthorName Plugin author's name. + * @type string $Name Name of the plugin. Should be unique. + * @type string $PluginURI Plugin URI. + * @type string $Version Plugin version. + * @type string $Description Plugin description. + * @type string $Author Plugin author's name. + * @type string $AuthorURI Plugin author's website address (if set). + * @type string $TextDomain Plugin textdomain. + * @type string $DomainPath Plugin's relative directory path to .mo files. + * @type bool $Network Whether the plugin can only be activated network-wide. + * @type string $RequiresWP Minimum required version of WordPress. + * @type string $RequiresPHP Minimum required version of PHP. + * @type string $UpdateURI ID of the plugin for update purposes, should be a URI. + * @type string $RequiresPlugins Comma separated list of dot org plugin slugs. + * @type string $Title Title of the plugin and link to the plugin's site (if set). + * @type string $AuthorName Plugin author's name. * } * @phpstan-return array{ * Name: string, @@ -83851,6 +87686,7 @@ function install_plugin_information() * RequiresWP: string, * RequiresPHP: string, * UpdateURI: string, + * RequiresPlugins: string, * Title: string, * AuthorName: string, * } @@ -83947,14 +87783,27 @@ function get_dropins() { } /** - * Returns drop-ins that WordPress uses. + * Returns drop-in plugins that WordPress uses. * * Includes Multisite drop-ins only when is_multisite() * * @since 3.0.0 - * @return array[] Key is file name. The value is an array, with the first value the - * purpose of the drop-in and the second value the name of the constant that must be - * true for the drop-in to be used, or true if no constant is required. + * + * @return array[] { + * Key is file name. The value is an array of data about the drop-in. + * + * @type array ...$0 { + * Data about the drop-in. + * + * @type string $0 The purpose of the drop-in. + * @type string|true $1 Name of the constant that must be true for the drop-in + * to be used, or true if no constant is required. + * } + * } + * @phpstan-return array */ function _get_dropins() { @@ -84144,13 +87993,14 @@ function validate_plugin($plugin) /** * Validates the plugin requirements for WordPress version and PHP version. * - * Uses the information from `Requires at least` and `Requires PHP` headers + * Uses the information from `Requires at least`, `Requires PHP` and `Requires Plugins` headers * defined in the plugin's main PHP file. * * @since 5.2.0 * @since 5.3.0 Added support for reading the headers from the plugin's * main PHP file, with `readme.txt` as a fallback. * @since 5.8.0 Removed support for using `readme.txt` as a fallback. + * @since 6.5.0 Added support for the 'Requires Plugins' header. * * @param string $plugin Path to the plugin file relative to the plugins directory. * @return true|WP_Error True if requirements are met, WP_Error on failure. @@ -84770,6 +88620,8 @@ function wp_add_privacy_policy_content($plugin_name, $policy_text) * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_plugins + * * @param string $plugin Path to the plugin file relative to the plugins directory. * @return bool True, if in the list of paused plugins. False, if not in the list. */ @@ -84781,6 +88633,8 @@ function is_plugin_paused($plugin) * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_plugins + * * @param string $plugin Path to the plugin file relative to the plugins directory. * @return array|false Array of error information as returned by `error_get_last()`, * or false if none was recorded. @@ -84813,7 +88667,8 @@ function resume_plugin($plugin, $redirect = '') * * @since 5.2.0 * - * @global string $pagenow The filename of the current screen. + * @global string $pagenow The filename of the current screen. + * @global WP_Paused_Extensions_Storage $_paused_plugins * @phpstan-return void */ function paused_plugins_notice() @@ -86630,6 +90485,7 @@ function _admin_search_query() * * @global string $hook_suffix * @global string $admin_body_class + * @global string $body_id * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $title Optional. Title of the Iframe page. Default empty. @@ -86718,22 +90574,22 @@ function compression_test() * * @see get_submit_button() * - * @param string $text The text of the button (defaults to 'Save Changes') + * @param string $text Optional. The text of the button. Defaults to 'Save Changes'. * @param string $type Optional. The type and CSS class(es) of the button. Core values * include 'primary', 'small', and 'large'. Default 'primary'. - * @param string $name The HTML name of the submit button. Defaults to "submit". If no - * id attribute is given in $other_attributes below, $name will be - * used as the button's id. - * @param bool $wrap True if the output button should be wrapped in a paragraph tag, - * false otherwise. Defaults to true. - * @param array|string $other_attributes Other attributes that should be output with the button, mapping - * attributes to their values, such as setting tabindex to 1, etc. - * These key/value attribute pairs will be output as attribute="value", - * where attribute is the key. Other attributes can also be provided - * as a string such as 'tabindex="1"', though the array format is - * preferred. Default null. + * @param string $name Optional. The HTML name of the submit button. If no `id` attribute + * is given in the `$other_attributes` parameter, `$name` will be used + * as the button's `id`. Default 'submit'. + * @param bool $wrap Optional. True if the output button should be wrapped in a paragraph tag, + * false otherwise. Default true. + * @param array|string $other_attributes Optional. Other attributes that should be output with the button, + * mapping attributes to their values, e.g. `array( 'id' => 'search-submit' )`. + * These key/value attribute pairs will be output as `attribute="value"`, + * where attribute is the key. Attributes can also be provided as a string, + * e.g. `id="search-submit"`, though the array format is generally preferred. + * Default empty string. */ - function submit_button($text = \null, $type = 'primary', $name = 'submit', $wrap = \true, $other_attributes = \null) + function submit_button($text = '', $type = 'primary', $name = 'submit', $wrap = \true, $other_attributes = '') { } /** @@ -86741,20 +90597,20 @@ function submit_button($text = \null, $type = 'primary', $name = 'submit', $wrap * * @since 3.1.0 * - * @param string $text Optional. The text of the button. Default 'Save Changes'. + * @param string $text Optional. The text of the button. Defaults to 'Save Changes'. * @param string $type Optional. The type and CSS class(es) of the button. Core values * include 'primary', 'small', and 'large'. Default 'primary large'. - * @param string $name Optional. The HTML name of the submit button. Defaults to "submit". - * If no id attribute is given in $other_attributes below, `$name` will - * be used as the button's id. Default 'submit'. - * @param bool $wrap Optional. True if the output button should be wrapped in a paragraph - * tag, false otherwise. Default true. + * @param string $name Optional. The HTML name of the submit button. If no `id` attribute + * is given in the `$other_attributes` parameter, `$name` will be used + * as the button's `id`. Default 'submit'. + * @param bool $wrap Optional. True if the output button should be wrapped in a paragraph tag, + * false otherwise. Default true. * @param array|string $other_attributes Optional. Other attributes that should be output with the button, - * mapping attributes to their values, such as `array( 'tabindex' => '1' )`. - * These attributes will be output as `attribute="value"`, such as - * `tabindex="1"`. Other attributes can also be provided as a string such - * as `tabindex="1"`, though the array format is typically cleaner. - * Default empty. + * mapping attributes to their values, e.g. `array( 'id' => 'search-submit' )`. + * These key/value attribute pairs will be output as `attribute="value"`, + * where attribute is the key. Attributes can also be provided as a string, + * e.g. `id="search-submit"`, though the array format is generally preferred. + * Default empty string. * @return string Submit button HTML. */ function get_submit_button($text = '', $type = 'primary large', $name = 'submit', $wrap = \true, $other_attributes = '') @@ -87058,7 +90914,7 @@ function get_theme_feature_list($api = \true) * * @since 2.8.0 * - * @param string $action API action to perform: 'query_themes', 'theme_information', + * @param string $action API action to perform: Accepts 'query_themes', 'theme_information', * 'hot_tags' or 'feature_list'. * @param array|object $args { * Optional. Array or object of arguments to serialize for the Themes API. Default empty array. @@ -87169,6 +91025,8 @@ function customize_themes_print_templates() * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string $theme Path to the theme directory relative to the themes directory. * @return bool True, if in the list of paused themes. False, not in the list. */ @@ -87180,6 +91038,8 @@ function is_theme_paused($theme) * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string $theme Path to the theme directory relative to the themes * directory. * @return array|false Array of error information as it was returned by @@ -87200,6 +91060,9 @@ function wp_get_theme_error($theme) * * @since 5.2.0 * + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. + * * @param string $theme Single theme to resume. * @param string $redirect Optional. URL to redirect to. Default empty string. * @return bool|WP_Error True on success, false if `$theme` was not paused, @@ -87213,7 +91076,8 @@ function resume_theme($theme, $redirect = '') * * @since 5.2.0 * - * @global string $pagenow The filename of the current screen. + * @global string $pagenow The filename of the current screen. + * @global WP_Paused_Extensions_Storage $_paused_themes * @phpstan-return void */ function paused_themes_notice() @@ -87291,7 +91155,7 @@ function wp_can_install_language_pack() * Upgrades the core of WordPress. * * This will create a .maintenance file at the base of the WordPress directory - * to ensure that people can not access the web site, when the files are being + * to ensure that people can not access the website, when the files are being * copied to their locations. * * The files in the `$_old_files` list will be removed and the new files @@ -87423,6 +91287,7 @@ function _upgrade_440_force_deactivate_incompatible_plugins() * @since 5.9.0 The minimum compatible version of Gutenberg is 11.9. * @since 6.1.1 The minimum compatible version of Gutenberg is 14.1. * @since 6.4.0 The minimum compatible version of Gutenberg is 16.5. + * @since 6.5.0 The minimum compatible version of Gutenberg is 17.6. */ function _upgrade_core_deactivate_incompatible_plugins() { @@ -87681,7 +91546,7 @@ function wp_recovery_mode_nag() * * @since 5.5.0 * - * @param string $type The type of update being checked: 'theme' or 'plugin'. + * @param string $type The type of update being checked: Either 'theme' or 'plugin'. * @return bool True if auto-updates are enabled for `$type`, false otherwise. * @phpstan-param 'theme'|'plugin' $type */ @@ -87693,7 +91558,7 @@ function wp_is_auto_update_enabled_for_type($type) * * @since 5.6.0 * - * @param string $type The type of update being checked: 'theme' or 'plugin'. + * @param string $type The type of update being checked: Either 'theme' or 'plugin'. * @param bool|null $update Whether to update. The value of null is internally used * to detect whether nothing has hooked into this filter. * @param object $item The update offer. @@ -88272,6 +92137,18 @@ function upgrade_630() function upgrade_640() { } + /** + * Executes changes made in WordPress 6.5.0. + * + * @ignore + * @since 6.5.0 + * + * @global int $wp_current_db_version The old (current) database version. + * @global wpdb $wpdb WordPress database abstraction object. + */ + function upgrade_650() + { + } /** * Executes network-level upgrade routines. * @@ -88728,7 +92605,7 @@ function admin_created_user_email($text) * * @since 5.6.0 * @since 6.2.0 Allow insecure HTTP connections for the local environment. - * @since 6.3.2 Validates the success and reject URLs to prevent javascript pseudo protocol being executed. + * @since 6.3.2 Validates the success and reject URLs to prevent `javascript` pseudo protocol from being executed. * * @param array $request { * The array of request data. All arguments are optional and may be empty. @@ -88751,12 +92628,11 @@ function wp_is_authorize_application_password_request_valid($request, $user) { } /** - * Validates the redirect URL protocol scheme. The protocol can be anything except http and javascript. + * Validates the redirect URL protocol scheme. The protocol can be anything except `http` and `javascript`. * * @since 6.3.2 * - * @param string $url - The redirect URL to be validated. - * + * @param string $url The redirect URL to be validated. * @return true|WP_Error True if the redirect URL is valid, a WP_Error object otherwise. */ function wp_is_authorize_application_redirect_url_valid($url) @@ -89196,9 +93072,9 @@ function wp_admin_bar_site_menu($wp_admin_bar) * Adds the "Edit site" link to the Toolbar. * * @since 5.9.0 + * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. * * @global string $_wp_current_template_id - * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @phpstan-return void @@ -89211,8 +93087,9 @@ function wp_admin_bar_edit_site_menu($wp_admin_bar) * * @since 4.3.0 * - * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @global WP_Customize_Manager $wp_customize + * + * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @phpstan-return void */ function wp_admin_bar_customize_menu($wp_admin_bar) @@ -89262,6 +93139,7 @@ function wp_admin_bar_edit_menu($wp_admin_bar) * Adds "Add New" menu. * * @since 3.1.0 + * @since 6.5.0 Added a New Site link for network installations. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @phpstan-return void @@ -89694,6 +93572,198 @@ function is_multi_author() function __clear_multi_author_cache() { } + /** + * Block Bindings API + * + * Contains functions for managing block bindings in WordPress. + * + * @package WordPress + * @subpackage Block Bindings + * @since 6.5.0 + */ + /** + * Registers a new block bindings source. + * + * Registering a source consists of defining a **name** for that source and a callback function specifying + * how to get a value from that source and pass it to a block attribute. + * + * Once a source is registered, any block that supports the Block Bindings API can use a value + * from that source by setting its `metadata.bindings` attribute to a value that refers to the source. + * + * Note that `register_block_bindings_source()` should be called from a handler attached to the `init` hook. + * + * + * ## Example + * + * ### Registering a source + * + * First, you need to define a function that will be used to get the value from the source. + * + * function my_plugin_get_custom_source_value( array $source_args, $block_instance, string $attribute_name ) { + * // Your custom logic to get the value from the source. + * // For example, you can use the `$source_args` to look up a value in a custom table or get it from an external API. + * $value = $source_args['key']; + * + * return "The value passed to the block is: $value" + * } + * + * The `$source_args` will contain the arguments passed to the source in the block's + * `metadata.bindings` attribute. See the example in the "Usage in a block" section below. + * + * function my_plugin_register_block_bindings_sources() { + * register_block_bindings_source( 'my-plugin/my-custom-source', array( + * 'label' => __( 'My Custom Source', 'my-plugin' ), + * 'get_value_callback' => 'my_plugin_get_custom_source_value', + * ) ); + * } + * add_action( 'init', 'my_plugin_register_block_bindings_sources' ); + * + * ### Usage in a block + * + * In a block's `metadata.bindings` attribute, you can specify the source and + * its arguments. Such a block will use the source to override the block + * attribute's value. For example: + * + * + *

Fallback text that gets replaced.

+ * + * + * @since 6.5.0 + * + * @param string $source_name The name of the source. It must be a string containing a namespace prefix, i.e. + * `my-plugin/my-custom-source`. It must only contain lowercase alphanumeric + * characters, the forward slash `/` and dashes. + * @param array $source_properties { + * The array of arguments that are used to register a source. + * + * @type string $label The label of the source. + * @type 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. + * } + * @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, + * } $source_properties + */ + function register_block_bindings_source(string $source_name, array $source_properties) + { + } + /** + * Unregisters a block bindings source. + * + * @since 6.5.0 + * + * @param string $source_name Block bindings source name including namespace. + * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise. + */ + function unregister_block_bindings_source(string $source_name) + { + } + /** + * Retrieves the list of all registered block bindings sources. + * + * @since 6.5.0 + * + * @return WP_Block_Bindings_Source[] The array of registered block bindings sources. + */ + function get_all_registered_block_bindings_sources() + { + } + /** + * Retrieves a registered block bindings source. + * + * @since 6.5.0 + * + * @param string $source_name The name of the source. + * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered. + */ + function get_block_bindings_source(string $source_name) + { + } + /** + * Pattern Overrides source for the Block Bindings. + * + * @since 6.5.0 + * @package WordPress + * @subpackage Block Bindings + */ + /** + * Gets value for the Pattern Overrides source. + * + * @since 6.5.0 + * @access private + * + * @param array $source_args Array containing source arguments used to look up the override value. + * Example: array( "key" => "foo" ). + * @param WP_Block $block_instance The block instance. + * @param string $attribute_name The name of the target attribute. + * @return mixed The value computed for the source. + */ + function _block_bindings_pattern_overrides_get_value(array $source_args, $block_instance, string $attribute_name) + { + } + /** + * Registers Pattern Overrides source in the Block Bindings registry. + * + * @since 6.5.0 + * @access private + */ + function _register_block_bindings_pattern_overrides_source() + { + } + /** + * Post Meta source for the block bindings. + * + * @since 6.5.0 + * @package WordPress + * @subpackage Block Bindings + */ + /** + * Gets value for Post Meta source. + * + * @since 6.5.0 + * @access private + * + * @param array $source_args Array containing source arguments used to look up the override value. + * Example: array( "key" => "foo" ). + * @param WP_Block $block_instance The block instance. + * @return mixed The value computed for the source. + */ + function _block_bindings_post_meta_get_value(array $source_args, $block_instance) + { + } + /** + * Registers Post Meta source in the block bindings registry. + * + * @since 6.5.0 + * @access private + */ + function _register_block_bindings_post_meta_source() + { + } /** * Block Editor API. * @@ -89994,6 +94064,7 @@ function wp_register_background_support($block_type) * it is also applied to non-server-rendered blocks. * * @since 6.4.0 + * @since 6.5.0 Added support for `backgroundPosition` and `backgroundRepeat` output. * @access private * * @param string $block_content Rendered block content. @@ -90158,6 +94229,21 @@ function wp_register_dimensions_support($block_type) function wp_apply_dimensions_support($block_type, $block_attributes) { } + /** + * Renders server-side dimensions styles to the block wrapper. + * This block support uses the `render_block` hook to ensure that + * it is also applied to non-server-rendered blocks. + * + * @since 6.5.0 + * @access private + * + * @param string $block_content Rendered block content. + * @param array $block Block object. + * @return string Filtered block content. + */ + function wp_render_dimensions_support($block_content, $block) + { + } /** * Elements styles block support. * @@ -90586,6 +94672,7 @@ function wp_get_typography_value_and_unit($raw_value, $options = array()) * * @since 6.1.0 * @since 6.3.0 Checks for unsupported min/max viewport values that cause invalid clamp values. + * @since 6.5.0 Returns early when min and max viewport subtraction is zero to avoid division by zero. * @access private * * @param array $args { @@ -90738,10 +94825,10 @@ function _get_block_templates_paths($base_directory) * @since 5.9.0 * @access private * - * @param string $template_type 'wp_template' or 'wp_template_part'. + * @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'. + * Array with template metadata if $template_type is one of 'wp_template' or 'wp_template_part', * null otherwise. * * @type string $slug Template slug. @@ -90752,6 +94839,7 @@ function _get_block_templates_paths($base_directory) * @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 */ function _get_block_template_file($template_type, $slug) { @@ -90763,7 +94851,7 @@ function _get_block_template_file($template_type, $slug) * @since 6.3.0 Added the `$query` parameter. * @access private * - * @param string $template_type 'wp_template' or 'wp_template_part'. + * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. * @param array $query { * Arguments to retrieve templates. Optional, empty by default. * @@ -90774,6 +94862,7 @@ function _get_block_template_file($template_type, $slug) * } * * @return array Template + * @phpstan-param 'wp_template'|'wp_template_part' $template_type * @phpstan-param array{ * slug__in?: string[], * slug__not_in?: string[], @@ -90852,8 +94941,9 @@ function _remove_theme_attribute_from_template_part_block(&$block) * @access private * * @param array $template_file Theme file. - * @param string $template_type 'wp_template' or 'wp_template_part'. + * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. * @return WP_Block_Template Template. + * @phpstan-param 'wp_template'|'wp_template_part' $template_type */ function _build_block_template_result_from_file($template_file, $template_type) { @@ -90917,7 +95007,7 @@ function _build_block_template_result_from_post($post) * @type string $area A 'wp_template_part_area' taxonomy value to filter by (for 'wp_template_part' template type only). * @type string $post_type Post type to get the templates for. * } - * @param string $template_type 'wp_template' or 'wp_template_part'. + * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'. * @return WP_Block_Template[] Array of block templates. * @phpstan-param array{ * slug__in?: string[], @@ -90925,6 +95015,7 @@ function _build_block_template_result_from_post($post) * area?: string, * post_type?: string, * } $query + * @phpstan-param 'wp_template'|'wp_template_part' $template_type */ function get_block_templates($query = array(), $template_type = 'wp_template') { @@ -90935,7 +95026,7 @@ function get_block_templates($query = array(), $template_type = 'wp_template') * @since 5.8.0 * * @param string $id Template unique identifier (example: 'theme_slug//template_slug'). - * @param string $template_type Optional. Template type: 'wp_template' or 'wp_template_part'. + * @param string $template_type Optional. Template type. Either 'wp_template' or 'wp_template_part'. * Default 'wp_template'. * @return WP_Block_Template|null Template. * @phpstan-param 'wp_template'|'wp_template_part' $template_type @@ -90951,7 +95042,7 @@ function get_block_template($id, $template_type = 'wp_template') * @since 5.9.0 * * @param string $id Template unique identifier (example: 'theme_slug//template_slug'). - * @param string $template_type Optional. Template type: 'wp_template' or 'wp_template_part'. + * @param string $template_type Optional. Template type. Either 'wp_template' or 'wp_template_part'. * Default 'wp_template'. * @return WP_Block_Template|null The found block template, or null if there isn't one. * @phpstan-param 'wp_template'|'wp_template_part' $template_type @@ -90964,7 +95055,8 @@ function get_block_file_template($id, $template_type = 'wp_template') * * @since 5.9.0 * - * @param string $part The block template part to print. Use "header" or "footer". + * @param string $part The block template part to print. Either 'header' or 'footer'. + * @phpstan-param 'header'|'footer' $part * @phpstan-return void */ function block_template_part($part) @@ -90992,7 +95084,7 @@ function block_footer_area() * @since 6.0.0 * * @param string $path The path of the file in the theme. - * @return Bool Whether this file is in an ignored directory. + * @return bool Whether this file is in an ignored directory. */ function wp_is_theme_directory_ignored($path) { @@ -91019,8 +95111,8 @@ function wp_generate_block_templates_export_file() * * @since 6.1.0 * - * @param string $slug The template slug to be created. - * @param boolean $is_custom Optional. Indicates if a template is custom or + * @param string $slug The template slug to be created. + * @param bool $is_custom Optional. Indicates if a template is custom or * part of the template hierarchy. Default false. * @param string $template_prefix Optional. The template prefix for the created template. * Used to extract the main template type, e.g. @@ -91031,6 +95123,25 @@ function wp_generate_block_templates_export_file() function get_template_hierarchy($slug, $is_custom = \false, $template_prefix = '') { } + /** + * Inject ignoredHookedBlocks metadata attributes into a template or template part. + * + * Given an object that represents a `wp_template` or `wp_template_part` post object + * prepared for inserting or updating the database, locate all blocks that have + * hooked blocks, and inject a `metadata.ignoredHookedBlocks` attribute into the anchor + * blocks to reflect the latter. + * + * @since 6.5.0 + * @access private + * + * @param stdClass $post An object representing a template or template part + * prepared for inserting or updating the database. + * @param WP_REST_Request $request Request object. + * @return stdClass The updated object representing a template or template part. + */ + function inject_ignored_hooked_blocks_metadata_attributes($post, $request) + { + } /** * Block template loader functions. * @@ -91181,6 +95292,7 @@ function remove_block_asset_path_prefix($asset_handle_or_path) * * @since 5.5.0 * @since 6.1.0 Added `$index` parameter. + * @since 6.5.0 Added support for `viewScriptModule` field. * * @param string $block_name Name of the block. * @param string $field_name Name of the metadata field. @@ -91202,14 +95314,33 @@ function generate_block_asset_handle($block_name, $field_name, $index = 0) function get_block_asset_url($path) { } + /** + * Finds a script module ID for the selected block metadata field. It detects + * when a path to file was provided and optionally finds a corresponding asset + * file with details necessary to register the script module under with an + * automatically generated module ID. It returns unprocessed script module + * ID otherwise. + * + * @since 6.5.0 + * + * @param array $metadata Block metadata. + * @param string $field_name Field name to pick from metadata. + * @param int $index Optional. Index of the script module ID to register when multiple + * items passed. Default 0. + * @return string|false Script module ID or false on failure. + */ + function register_block_script_module_id($metadata, $field_name, $index = 0) + { + } /** * Finds a script handle for the selected block metadata field. It detects - * when a path to file was provided and finds a corresponding asset file - * with details necessary to register the script under automatically + * when a path to file was provided and optionally finds a corresponding asset + * file with details necessary to register the script under automatically * generated handle name. It returns unprocessed script handle otherwise. * * @since 5.5.0 * @since 6.1.0 Added `$index` parameter. + * @since 6.5.0 The asset file is optional. Added script handle support in the asset file. * * @param array $metadata Block metadata. * @param string $field_name Field name to pick from metadata. @@ -91258,6 +95389,7 @@ function get_block_metadata_i18n_schema() * @since 6.1.0 Added support for `render` field. * @since 6.3.0 Added `selectors` field. * @since 6.4.0 Added support for `blockHooks` field. + * @since 6.5.0 Added support for `allowedBlocks`, `viewScriptModule`, and `viewStyle` fields. * * @param string $file_or_folder Path to the JSON file with metadata definition for * the block or path to the folder where the `block.json` file is located. @@ -91272,6 +95404,7 @@ function get_block_metadata_i18n_schema() * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, + * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], @@ -91282,15 +95415,17 @@ function get_block_metadata_i18n_schema() * supports?: array|null, * example?: array|null, * render_callback?: callable|null, + * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, - * block_hooks?: array[], + * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], + * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ function register_block_type_from_metadata($file_or_folder, $args = array()) @@ -91319,6 +95454,7 @@ function register_block_type_from_metadata($file_or_folder, $args = array()) * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, + * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], @@ -91329,15 +95465,17 @@ function register_block_type_from_metadata($file_or_folder, $args = array()) * supports?: array|null, * example?: array|null, * render_callback?: callable|null, + * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, - * block_hooks?: array[], + * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], + * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ function register_block_type($block_type, $args = array()) @@ -91413,6 +95551,42 @@ function get_dynamic_block_names() function get_hooked_blocks() { } + /** + * Returns the markup for blocks hooked to the given anchor block in a specific relative position. + * + * @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 + * @phpstan-param 'before'|'after'|'first_child'|'last_child' $relative_position + */ + function insert_hooked_blocks(&$parsed_anchor_block, $relative_position, $hooked_blocks, $context) + { + } + /** + * 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.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. + * @phpstan-param 'before'|'after'|'first_child'|'last_child' $relative_position + */ + function set_ignored_hooked_blocks_metadata(&$parsed_anchor_block, $relative_position, $hooked_blocks, $context) + { + } /** * Returns a function that injects the theme attribute into, and hooked blocks before, a given block. * @@ -91423,14 +95597,19 @@ function get_hooked_blocks() * This function is meant for internal use only. * * @since 6.4.0 + * @since 6.5.0 Added $callback argument. * @access private * - * @param array $hooked_blocks An array of blocks hooked to another given block. - * @param WP_Block_Template|array $context A block template, template part, or pattern that the blocks belong to. + * @param array $hooked_blocks An array of blocks hooked to another given block. + * @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 callable A function that returns the serialized markup for the given block, * including the markup for any hooked blocks before it. */ - function make_before_block_visitor($hooked_blocks, $context) + function make_before_block_visitor($hooked_blocks, $context, $callback = 'insert_hooked_blocks') { } /** @@ -91443,14 +95622,19 @@ function make_before_block_visitor($hooked_blocks, $context) * This function is meant for internal use only. * * @since 6.4.0 + * @since 6.5.0 Added $callback argument. * @access private * - * @param array $hooked_blocks An array of blocks hooked to another block. - * @param WP_Block_Template|array $context A block template, template part, or pattern that the blocks belong to. + * @param array $hooked_blocks An array of blocks hooked to another block. + * @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 callable A function that returns the serialized markup for the given block, * including the markup for any hooked blocks after it. */ - function make_after_block_visitor($hooked_blocks, $context) + function make_after_block_visitor($hooked_blocks, $context, $callback = 'insert_hooked_blocks') { } /** @@ -91624,8 +95808,8 @@ function filter_block_content($text, $allowed_html = 'post', $allowed_protocols /** * Callback used for regular expression replacement in filter_block_content(). * - * @private * @since 6.2.1 + * @access private * * @param array $matches Array of preg_replace_callback matches. * @return string Replacement string. @@ -91779,7 +95963,15 @@ function block_version($content) * @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(). * @return bool True if the block style was registered with success and false otherwise. + * @phpstan-param array{ + * name?: string, + * label?: string, + * inline_style?: string, + * style_handle?: string, + * is_default?: bool, + * } $style_properties See WP_Block_Styles_Registry::register() */ function register_block_style($block_name, $style_properties) { @@ -91891,19 +96083,20 @@ function get_comments_pagination_arrow($block, $pagination_type = 'next') } /** * Strips all HTML from the content of footnotes, and sanitizes the ID. + * * This function expects slashed data on the footnotes content. * * @access private * @since 6.3.2 * - * @param string $footnotes JSON encoded string of an array containing the content and ID of each footnote. - * @return string Filtered content without any HTML on the footnote content and with the sanitized id. + * @param string $footnotes JSON-encoded string of an array containing the content and ID of each footnote. + * @return string Filtered content without any HTML on the footnote content and with the sanitized ID. */ function _wp_filter_post_meta_footnotes($footnotes) { } /** - * Adds the filters to filter footnotes meta field. + * Adds the filters for footnotes meta field. * * @access private * @since 6.3.2 @@ -91912,7 +96105,7 @@ function _wp_footnotes_kses_init_filters() { } /** - * Removes the filters that filter footnotes meta field. + * Removes the filters for footnotes meta field. * * @access private * @since 6.3.2 @@ -91921,7 +96114,7 @@ function _wp_footnotes_remove_filters() { } /** - * Registers the filter of footnotes meta field if the user does not have unfiltered_html capability. + * Registers the filter of footnotes meta field if the user does not have `unfiltered_html` capability. * * @access private * @since 6.3.2 @@ -91930,12 +96123,12 @@ function _wp_footnotes_kses_init() { } /** - * Initializes footnotes meta field filters when imported data should be filtered. + * Initializes the filters for footnotes meta field when imported data should be filtered. * - * This filter is the last being executed on force_filtered_html_on_import. - * If the input of the filter is true it means we are in an import situation and should - * enable kses, independently of the user capabilities. - * So in that case we call _wp_footnotes_kses_init_filters; + * This filter is the last one being executed on {@see 'force_filtered_html_on_import'}. + * If the input of the filter is true, it means we are in an import situation and should + * enable kses, independently of the user capabilities. So in that case we call + * _wp_footnotes_kses_init_filters(). * * @access private * @since 6.3.2 @@ -92473,17 +96666,7 @@ function register_block_core_cover() * * @return string Returns the block content. */ - function render_block_core_file($attributes, $content, $block) - { - } - /** - * Ensure that the view script has the `wp-interactivity` dependency. - * - * @since 6.4.0 - * - * @global WP_Scripts $wp_scripts - */ - function block_core_file_ensure_interactivity_dependency() + function render_block_core_file($attributes, $content) { } /** @@ -92519,6 +96702,14 @@ function render_block_core_footnotes($attributes, $content, $block) function register_block_core_footnotes() { } + /** + * Registers the footnotes meta field required for footnotes to work. + * + * @since 6.5.0 + */ + function register_block_core_footnotes_post_meta() + { + } /** * Adds the footnotes field to the revisions display. * @@ -92564,11 +96755,7 @@ function block_core_gallery_data_id_backcompatibility($parsed_block) { } /** - * Adds a style tag for the --wp--style--unstable-gallery-gap var. - * - * The Gallery block needs to recalculate Image block width based on - * the current gap setting in order to maintain the number of flex columns - * so a css var is added to allow this. + * Renders the `core/gallery` block on the server. * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. @@ -92707,14 +96894,7 @@ function block_core_image_get_lightbox_settings($block) function block_core_image_render_lightbox($block_content, $block) { } - /** - * Ensures that the view script has the `wp-interactivity` dependency. - * - * @since 6.4.0 - * - * @global WP_Scripts $wp_scripts - */ - function block_core_image_ensure_interactivity_dependency() + function block_core_image_print_lightbox_overlay() { } /** @@ -92887,7 +97067,7 @@ function register_block_core_loginout() { } /** - * Server-side rendering of the `core/navigation-link` block. + * Server-side registering and rendering of the `core/navigation-link` block. * * @package WordPress */ @@ -92955,9 +97135,31 @@ function build_variation_for_navigation_link($entity, $kind) { } /** - * Register the navigation link block. + * Filters the registered variations for a block type. + * Returns the dynamically built variations for all post-types and taxonomies. * - * @uses render_block_core_navigation() + * @since 6.5.0 + * + * @param array $variations Array of registered variations for a block type. + * @param WP_Block_Type $block_type The full block type object. + */ + function block_core_navigation_link_filter_variations($variations, $block_type) + { + } + /** + * Returns an array of variations for the navigation link block. + * + * @since 6.5.0 + * + * @return array + */ + function block_core_navigation_link_build_variations() + { + } + /** + * Registers the navigation link block. + * + * @uses render_block_core_navigation_link() * @throws WP_Error An WP_Error exception parsing the block definition. */ function register_block_core_navigation_link() @@ -93027,16 +97229,25 @@ function block_core_navigation_get_menu_items_at_location($location) 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. + * + * @param array $attributes The block attributes. + * @return WP_Block_List Returns the inner blocks for the navigation block. + */ + function block_core_navigation_get_inner_blocks_from_unstable_location($attributes) + { + } /** * Add Interactivity API directives to the navigation-submenu and page-list * blocks markup using the Tag Processor. * - * @param string $w Markup of the navigation block. - * @param array $block_attributes Block attributes. + * @param WP_HTML_Tag_Processor $tags Markup of the navigation block. + * @param array $block_attributes Block attributes. * * @return string Submenu markup with the directives injected. */ - function block_core_navigation_add_directives_to_submenu($w, $block_attributes) + function block_core_navigation_add_directives_to_submenu($tags, $block_attributes) { } /** @@ -93129,7 +97340,7 @@ function block_core_navigation_from_block_get_post_ids($block) * @param string $content The saved content. * @param WP_Block $block The parsed block. * - * @return string Returns the post content with the legacy widget added. + * @return string Returns the navigation block markup. */ function render_block_core_navigation($attributes, $content, $block) { @@ -93153,16 +97364,6 @@ function register_block_core_navigation() function block_core_navigation_typographic_presets_backcompatibility($parsed_block) { } - /** - * Ensure that the view script has the `wp-interactivity` dependency. - * - * @since 6.4.0 - * - * @global WP_Scripts $wp_scripts - */ - function block_core_navigation_ensure_interactivity_dependency() - { - } /** * Turns menu item data into a nested array of parsed blocks * @@ -93220,6 +97421,81 @@ function block_core_navigation_maybe_use_classic_menu_fallback() 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. + * + * @param string $serialized_block The serialized markup of a block and its inner blocks. + * @return string + */ + 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. + * + * @param array $inner_blocks Parsed inner blocks of a Navigation block. + * @param WP_Post $post `wp_navigation` post object corresponding to the block. + * + * @return array the normalized parsed blocks. + */ + function block_core_navigation_mock_parsed_block($inner_blocks, $post) + { + } + /** + * Insert hooked blocks into a Navigation block. + * + * Given a Navigation block's inner blocks and its corresponding `wp_navigation` post object, + * this function inserts hooked blocks into it, and returns the serialized inner blocks in a + * mock Navigation block wrapper. + * + * If there are any hooked blocks that need to be inserted as the Navigation block's first or last + * 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. + * + * @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. + */ + function block_core_navigation_insert_hooked_blocks($inner_blocks, $post) + { + } + /** + * Insert ignoredHookedBlocks meta into the Navigation block and its inner blocks. + * + * Given a Navigation block's inner blocks and its corresponding `wp_navigation` post object, + * this function inserts ignoredHookedBlocks meta into it, and returns the serialized inner blocks in a + * mock Navigation block wrapper. + * + * @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. + */ + function block_core_navigation_set_ignored_hooked_blocks_metadata($inner_blocks, $post) + { + } + /** + * Updates the post meta with the list of ignored hooked blocks when the navigation is created or updated via the REST API. + * + * @access private + * @since 6.5.0 + * + * @param stdClass $post Post object. + * @return stdClass The updated post object. + */ + 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. + * + * @param WP_REST_Response $response The response object. + * @param WP_Post $post Post object. + * @return WP_REST_Response The response object. + */ + function block_core_navigation_insert_hooked_blocks_into_rest_response($response, $post) + { + } /** * Server-side rendering of the `core/page-list-item` block. * @@ -93319,6 +97595,8 @@ function register_block_core_pattern() * * @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper. * + * @global WP_Embed $wp_embed Used to process embedded content within patterns + * * @param array $attributes Block attributes. * * @return string Returns the output of the pattern. @@ -93605,6 +97883,14 @@ function register_block_core_post_template() function render_block_core_post_terms($attributes, $content, $block) { } + /** + * Returns the available variations for the `core/post-terms` block. + * + * @return array The available variations for the block. + */ + function block_core_post_terms_build_variations() + { + } /** * Registers the `core/post-terms` block on the server. */ @@ -93792,16 +98078,6 @@ function register_block_core_query_title() function render_block_core_query($attributes, $content, $block) { } - /** - * Ensure that the view script has the `wp-interactivity` dependency. - * - * @since 6.4.0 - * - * @global WP_Scripts $wp_scripts - */ - function block_core_query_ensure_interactivity_dependency() - { - } /** * Registers the `core/query` block on the server. */ @@ -93881,7 +98157,7 @@ function register_block_core_rss() * * @return string The search block markup. */ - function render_block_core_search($attributes, $content, $block) + function render_block_core_search($attributes) { } /** @@ -93890,16 +98166,6 @@ function render_block_core_search($attributes, $content, $block) function register_block_core_search() { } - /** - * Ensure that the view script has the `wp-interactivity` dependency. - * - * @since 6.4.0 - * - * @global WP_Scripts $wp_scripts - */ - function block_core_search_ensure_interactivity_dependency() - { - } /** * Builds the correct top level classnames for the 'core/search' block. * @@ -94497,7 +98763,8 @@ function wp_list_bookmarks($args = '') * * @since 2.1.0 * - * @global wpdb $wpdb WordPress database abstraction object. + * @global object $link Current link object. + * @global wpdb $wpdb WordPress database abstraction object. * * @param int|stdClass $bookmark * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which @@ -96384,6 +100651,7 @@ function unregister_block_pattern_category($category_name) * blockTypes?: string[], * postTypes?: string[], * templateTypes?: string[], + * filePath?: string, * } $pattern_properties See WP_Block_Patterns_Registry::register() */ function register_block_pattern($pattern_name, $pattern_properties) @@ -97045,15 +101313,17 @@ function wp_comment_form_unfiltered_html_nonce() * * @since 1.5.0 * - * @global WP_Query $wp_query WordPress Query object. - * @global WP_Post $post Global post object. - * @global wpdb $wpdb WordPress database abstraction object. + * @global WP_Query $wp_query WordPress Query object. + * @global WP_Post $post Global post object. + * @global wpdb $wpdb WordPress database abstraction object. * @global int $id - * @global WP_Comment $comment Global comment object. + * @global WP_Comment $comment Global comment object. * @global string $user_login * @global string $user_identity * @global bool $overridden_cpage * @global bool $withcomments + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. * * @param string $file Optional. The file to load. Default '/comments.php'. * @param bool $separate_comments Optional. Whether to separate the comments by comment type. @@ -97660,7 +101930,8 @@ function get_comment_statuses() * * @param string $post_type Optional. Post type. Default 'post'. * @param string $comment_type Optional. Comment type. Default 'comment'. - * @return string Expected return value is 'open' or 'closed'. + * @return string Either 'open' or 'closed'. + * @phpstan-return 'open'|'closed' */ function get_default_comment_status($post_type = 'post', $comment_type = 'comment') { @@ -98560,10 +102831,10 @@ function privacy_ping_filter($sites) * @param string $trackback_url URL to send trackbacks. * @param string $title Title of post. * @param string $excerpt Excerpt of post. - * @param int $ID Post ID. + * @param int $post_id Post ID. * @return int|false|void Database query from update. */ - function trackback($trackback_url, $title, $excerpt, $ID) + function trackback($trackback_url, $title, $excerpt, $post_id) { } /** @@ -98860,8 +103131,8 @@ function wp_schedule_single_event($timestamp, $hook, $args = array(), $wp_error * The action will trigger when someone visits your WordPress site if the scheduled * time has passed. * - * Valid values for the recurrence are 'hourly', 'daily', and 'twicedaily'. These can - * be extended using the {@see 'cron_schedules'} filter in wp_get_schedules(). + * Valid values for the recurrence are 'hourly', 'twicedaily', 'daily', and 'weekly'. + * These can be extended using the {@see 'cron_schedules'} filter in wp_get_schedules(). * * Use wp_next_scheduled() to prevent duplicate events. * @@ -99315,6 +103586,8 @@ function get_postdata($postid) * * @since 1.0.1 * @deprecated 1.5.0 + * + * @global WP_Query $wp_query WordPress Query object. */ function start_wp() { @@ -100756,6 +105029,8 @@ function unregister_widget_control($id) * @deprecated 3.0.0 Use delete_user_meta() * @see delete_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID. * @param string $meta_key Metadata key. * @param mixed $meta_value Optional. Metadata value. Default empty. @@ -100776,6 +105051,8 @@ function delete_usermeta($user_id, $meta_key, $meta_value = '') * @deprecated 3.0.0 Use get_user_meta() * @see get_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID * @param string $meta_key Optional. Metadata key. Default empty. * @return mixed @@ -100796,6 +105073,8 @@ function get_usermeta($user_id, $meta_key = '') * @deprecated 3.0.0 Use update_user_meta() * @see update_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. @@ -101067,6 +105346,8 @@ function index_rel_link() * @since 2.8.0 * @deprecated 3.3.0 * + * @global WP_Post $post Global post object. + * * @param string $title Optional. Link title format. Default '%title'. * @return string */ @@ -101928,8 +106209,6 @@ function _wp_register_meta_args_whitelist($args, $default_args) * @deprecated 5.5.0 Use add_allowed_options() instead. * Please consider writing more inclusive code. * - * @global array $allowed_options - * * @param array $new_options * @param string|array $options * @return array @@ -101944,8 +106223,6 @@ function add_option_whitelist($new_options, $options = '') * @deprecated 5.5.0 Use remove_allowed_options() instead. * Please consider writing more inclusive code. * - * @global array $allowed_options - * * @param array $del_options * @param string|array $options * @return array @@ -102714,6 +106991,39 @@ function _remove_theme_attribute_in_block_template_content($template_content) function the_block_template_skip_link() { } + /** + * Ensure that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ + function block_core_query_ensure_interactivity_dependency() + { + } + /** + * Ensure that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ + function block_core_file_ensure_interactivity_dependency() + { + } + /** + * Ensures that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ + function block_core_image_ensure_interactivity_dependency() + { + } /** * oEmbed API: Top-level oEmbed functionality * @@ -103695,16 +108005,16 @@ function fetch_feed($url) * @since 6.4.0 * * @param array[][] $fonts { - * Optional. The font-families and their font variations. Default empty array. + * Optional. The font-families and their font faces. Default empty array. * - * @type string $font-family => array[] $variations { - * Optional. An associated array of font variations for this font-family. - * Each variation has the following structure. + * @type array { + * 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 $font_variation { + * @type array { * @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'. + * @type string $font-style Optional. The font-style property. Default 'normal'. * @type string $font-weight Optional. The font-weight property. Default '400'. * @type string $font-display Optional. The font-display property. Default 'fallback'. * @type string $ascent-override Optional. The ascent-override property. @@ -103719,31 +108029,148 @@ function fetch_feed($url) * } * } * } - * @phpstan-param array[]{ - * font-family?: string{ - * font_variation?: array{ - * font-family: string, - * src: string|string[], - * font_style?: string, - * font-weight?: string, - * font-display?: string, - * ascent-override?: string, - * descent-override?: string, - * font-stretch?: string, - * font-variant?: string, - * font-feature-settings?: string, - * font-variation-settings?: string, - * line-gap-override?: string, - * size-adjust?: string, - * unicode-range?: string, - * }, - * }, - * } $fonts * @phpstan-return void */ function wp_print_font_faces($fonts = array()) { } + /** + * Registers a new font collection in the font library. + * + * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema + * the font collection data must adhere to. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, + * and underscores. See sanitize_title(). + * @param array $args { + * Font collection data. + * + * @type string $name Required. Name of the font collection shown in the Font Library. + * @type string $description Optional. A short descriptive summary of the font collection. Default empty. + * @type array|string $font_families Required. Array of font family definitions that are in the collection, + * or a string containing the path or URL to a JSON file containing the font collection. + * @type array $categories Optional. Array of categories, each with a name and slug, that are used by the + * fonts in the collection. Default empty. + * } + * @return WP_Font_Collection|WP_Error A font collection if it was registered + * successfully, or WP_Error object on failure. + * @phpstan-param array{ + * name?: string, + * description?: string, + * font_families?: array|string, + * categories?: array, + * } $args + */ + function wp_register_font_collection(string $slug, array $args) + { + } + /** + * Unregisters a font collection from the Font Library. + * + * @since 6.5.0 + * + * @param string $slug Font collection slug. + * @return bool True if the font collection was unregistered successfully, else false. + */ + function wp_unregister_font_collection(string $slug) + { + } + /** + * Retrieves font uploads directory information. + * + * Same as wp_font_dir() but "light weight" as it doesn't attempt to create the font uploads directory. + * Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases + * when not uploading files. + * + * @since 6.5.0 + * + * @see wp_font_dir() + * + * @return array See wp_font_dir() for description. + */ + function wp_get_font_dir() + { + } + /** + * Returns an array containing the current fonts upload directory's path and URL. + * + * @since 6.5.0 + * + * @param bool $create_dir Optional. Whether to check and create the font uploads directory. Default true. + * @return array { + * Array of information about the font upload directory. + * + * @type string $path Base directory and subdirectory or full path to the fonts upload directory. + * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory. + * @type string $subdir Subdirectory + * @type string $basedir Path without subdir. + * @type string $baseurl URL path without subdir. + * @type string|false $error False or error message. + * } + * @phpstan-return array{ + * path: string, + * url: string, + * subdir: string, + * basedir: string, + * baseurl: string, + * error: string|false, + * } + */ + function wp_font_dir($create_dir = \true) + { + } + /** + * A callback function for use in the {@see 'upload_dir'} filter. + * + * This function is intended for internal use only and should not be used by plugins and themes. + * Use wp_get_font_dir() instead. + * + * @since 6.5.0 + * @access private + * + * @param string $font_dir The font directory. + * @return string The modified font directory. + */ + function _wp_filter_font_directory($font_dir) + { + } + /** + * Deletes child font faces when a font family is deleted. + * + * @access private + * @since 6.5.0 + * + * @param int $post_id Post ID. + * @param WP_Post $post Post object. + * @phpstan-return void + */ + function _wp_after_delete_font_family($post_id, $post) + { + } + /** + * Deletes associated font files when a font face is deleted. + * + * @access private + * @since 6.5.0 + * + * @param int $post_id Post ID. + * @param WP_Post $post Post object. + * @phpstan-return void + */ + function _wp_before_delete_font_face($post_id, $post) + { + } + /** + * Register the default font collections. + * + * @access private + * @since 6.5.0 + */ + function _wp_register_default_font_collections() + { + } /** * Main WordPress Formatting API. * @@ -105402,8 +109829,8 @@ function wp_make_link_relative($link) * @global wpdb $wpdb WordPress database abstraction object. * * @param string $option The name of the option. - * @param string $value The unsanitized value. - * @return string Sanitized value. + * @param mixed $value The unsanitized value. + * @return mixed Sanitized value. */ function sanitize_option($option, $value) { @@ -106597,7 +111024,7 @@ function do_feed_atom($for_comments) * Displays the default robots.txt file content. * * @since 2.1.0 - * @since 5.3.0 Remove the "Disallow: /" output if search engine visiblity is + * @since 5.3.0 Remove the "Disallow: /" output if search engine visibility is * discouraged in favor of robots meta HTML tag via wp_robots_no_robots() * filter callback. */ @@ -107107,6 +111534,7 @@ function wp_check_filetype_and_ext($file, $filename, $mimes = \null) * * @since 4.7.1 * @since 5.8.0 Added support for WebP images. + * @since 6.5.0 Added support for AVIF images. * * @param string $file Full path to the file. * @return string|false The actual mime type or false if the type cannot be determined. @@ -107371,22 +111799,24 @@ function _wp_die_process_input($message, $title = '', $args = array()) { } /** - * Encodes a variable into JSON, with some sanity checks. + * Encodes a variable into JSON, with some confidence checks. * * @since 4.1.0 * @since 5.3.0 No longer handles support for PHP < 5.6. + * @since 6.5.0 The `$data` parameter has been renamed to `$value` and + * the `$options` parameter to `$flags` for parity with PHP. * - * @param mixed $data Variable (usually an array or object) to encode as JSON. - * @param int $options Optional. Options to be passed to json_encode(). Default 0. - * @param int $depth Optional. Maximum depth to walk through $data. Must be - * greater than 0. Default 512. + * @param mixed $value Variable (usually an array or object) to encode as JSON. + * @param int $flags Optional. Options to be passed to json_encode(). Default 0. + * @param int $depth Optional. Maximum depth to walk through $value. Must be + * greater than 0. Default 512. * @return string|false The JSON encoded string, or false if it cannot be encoded. */ - function wp_json_encode($data, $options = 0, $depth = 512) + function wp_json_encode($value, $flags = 0, $depth = 512) { } /** - * Performs sanity checks on data that shall be encoded to JSON. + * Performs confidence checks on data that shall be encoded to JSON. * * @ignore * @since 4.1.0 @@ -107396,11 +111826,11 @@ function wp_json_encode($data, $options = 0, $depth = 512) * * @throws Exception If depth limit is reached. * - * @param mixed $data Variable (usually an array or object) to encode as JSON. - * @param int $depth Maximum depth to walk through $data. Must be greater than 0. + * @param mixed $value Variable (usually an array or object) to encode as JSON. + * @param int $depth Maximum depth to walk through $value. Must be greater than 0. * @return mixed The sanitized data that shall be encoded to JSON. */ - function _wp_json_sanity_check($data, $depth) + function _wp_json_sanity_check($value, $depth) { } /** @@ -107429,10 +111859,10 @@ function _wp_json_convert_string($input_string) * has been dropped. * @access private * - * @param mixed $data Native representation. + * @param mixed $value Native representation. * @return bool|int|float|null|string|array Data ready for `json_encode()`. */ - function _wp_json_prepare_data($data) + function _wp_json_prepare_data($value) { } /** @@ -107440,14 +111870,14 @@ function _wp_json_prepare_data($data) * * @since 3.5.0 * @since 4.7.0 The `$status_code` parameter was added. - * @since 5.6.0 The `$options` parameter was added. + * @since 5.6.0 The `$flags` parameter was added. * * @param mixed $response Variable (usually an array or object) to encode as JSON, * then print and die. * @param int $status_code Optional. The HTTP status code to output. Default null. - * @param int $options Optional. Options to be passed to json_encode(). Default 0. + * @param int $flags Optional. Options to be passed to json_encode(). Default 0. */ - function wp_send_json($response, $status_code = \null, $options = 0) + function wp_send_json($response, $status_code = \null, $flags = 0) { } /** @@ -107455,35 +111885,35 @@ function wp_send_json($response, $status_code = \null, $options = 0) * * @since 3.5.0 * @since 4.7.0 The `$status_code` parameter was added. - * @since 5.6.0 The `$options` parameter was added. + * @since 5.6.0 The `$flags` parameter was added. * - * @param mixed $data Optional. Data to encode as JSON, then print and die. Default null. + * @param mixed $value Optional. Data to encode as JSON, then print and die. Default null. * @param int $status_code Optional. The HTTP status code to output. Default null. - * @param int $options Optional. Options to be passed to json_encode(). Default 0. + * @param int $flags Optional. Options to be passed to json_encode(). Default 0. * @phpstan-return never */ - function wp_send_json_success($data = \null, $status_code = \null, $options = 0) + function wp_send_json_success($value = \null, $status_code = \null, $flags = 0) { } /** * Sends a JSON response back to an Ajax request, indicating failure. * - * If the `$data` parameter is a WP_Error object, the errors + * If the `$value` parameter is a WP_Error object, the errors * within the object are processed and output as an array of error * codes and corresponding messages. All other types are output * without further processing. * * @since 3.5.0 - * @since 4.1.0 The `$data` parameter is now processed if a WP_Error object is passed in. + * @since 4.1.0 The `$value` parameter is now processed if a WP_Error object is passed in. * @since 4.7.0 The `$status_code` parameter was added. - * @since 5.6.0 The `$options` parameter was added. + * @since 5.6.0 The `$flags` parameter was added. * - * @param mixed $data Optional. Data to encode as JSON, then print and die. Default null. + * @param mixed $value Optional. Data to encode as JSON, then print and die. Default null. * @param int $status_code Optional. The HTTP status code to output. Default null. - * @param int $options Optional. Options to be passed to json_encode(). Default 0. + * @param int $flags Optional. Options to be passed to json_encode(). Default 0. * @phpstan-return never */ - function wp_send_json_error($data = \null, $status_code = \null, $options = 0) + function wp_send_json_error($value = \null, $status_code = \null, $flags = 0) { } /** @@ -107588,6 +112018,23 @@ function _delete_option_fresh_site() function _mce_set_direction($mce_init) { } + /** + * Determines whether WordPress is currently serving a REST API request. + * + * The function relies on the 'REST_REQUEST' global. As such, it only returns true when an actual REST _request_ is + * being made. It does not return true when a REST endpoint is hit as part of another request, e.g. for preloading a + * REST response. See {@see wp_is_rest_endpoint()} for that purpose. + * + * This function should not be called until the {@see 'parse_request'} action, as the constant is only defined then, + * even for an actual REST request. + * + * @since 6.5.0 + * + * @return bool True if it's a WordPress REST API request, false otherwise. + */ + function wp_is_serving_rest_request() + { + } /** * Converts smiley code to the icon graphic file equivalent. * @@ -109289,6 +113736,7 @@ function wp_get_admin_notice($message, $args = array()) * @type bool $dismissible Optional. Whether the admin notice is dismissible. Default false. * @type string $id Optional. The value of the admin notice's ID attribute. Default empty string. * @type string[] $additional_classes Optional. A string array of class names. Default empty array. + * @type string[] $attributes Optional. Additional attributes for the notice div. Default empty array. * @type bool $paragraph_wrap Optional. Whether to wrap the message in paragraph tags. Default true. * } * @phpstan-param array{ @@ -109296,6 +113744,7 @@ function wp_get_admin_notice($message, $args = array()) * dismissible?: bool, * id?: string, * additional_classes?: string[], + * attributes?: string[], * paragraph_wrap?: bool, * } $args */ @@ -110200,8 +114649,9 @@ function _wp_render_title_tag() * @param string $sep Optional. How to separate the various items within the page title. * Default '»'. * @param bool $display Optional. Whether to display or retrieve title. Default true. - * @param string $seplocation Optional. Location of the separator ('left' or 'right'). + * @param string $seplocation Optional. Location of the separator (either 'left' or 'right'). * @return string|void String when `$display` is false, nothing otherwise. + * @phpstan-param 'left'|'right' $seplocation * @phpstan-return ($display is true ? void : string) */ function wp_title($sep = '»', $display = \true, $seplocation = '') @@ -110854,7 +115304,7 @@ function wp_site_icon() } /** * Prints resource hints to browsers for pre-fetching, pre-rendering - * and pre-connecting to web sites. + * and pre-connecting to websites. * * Gives hints to browsers to prefetch specific pages or render them * in the background, to perform DNS lookups or to begin the connection @@ -110923,12 +115373,12 @@ function user_can_richedit() /** * Finds out which editor should be displayed by default. * - * Works out which of the two editors to display as the current editor for a + * Works out which of the editors to display as the current editor for a * user. The 'html' setting is for the "Text" editor tab. * * @since 2.5.0 * - * @return string Either 'tinymce', or 'html', or 'test' + * @return string Either 'tinymce', 'html', or 'test' * @phpstan-return 'tinymce'|'html'|'test' */ function wp_default_editor() @@ -111557,6 +116007,8 @@ function wp_get_global_styles_custom_css() * Adds global style rules to the inline style for each block. * * @since 6.1.0 + * + * @global WP_Styles $wp_styles */ function wp_add_global_styles_for_blocks() { @@ -112405,6 +116857,114 @@ function wp_update_urls_to_https() function wp_update_https_migration_required($old_url, $new_url) { } + /** + * Interactivity API: Functions and hooks + * + * @package WordPress + * @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. + * + * It provides access to the WP_Interactivity_API instance, creating one if it + * doesn't exist yet. + * + * @since 6.5.0 + * + * @global WP_Interactivity_API $wp_interactivity + * + * @return WP_Interactivity_API The main WP_Interactivity_API instance. + */ + function wp_interactivity() : \WP_Interactivity_API + { + } + /** + * Processes the interactivity directives contained within the HTML content + * and updates the markup accordingly. + * + * @since 6.5.0 + * + * @param string $html The HTML content to process. + * @return string The processed HTML content. It returns the original content when the HTML contains unbalanced tags. + */ + function wp_interactivity_process_directives(string $html) : string + { + } + /** + * Gets and/or sets the initial state of an Interactivity API store for a + * given namespace. + * + * If state for that store namespace already exists, it merges the new + * provided state with the existing one. + * + * @since 6.5.0 + * + * @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 + * store namespace. + * @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 + { + } + /** + * Gets and/or sets the configuration of the Interactivity API for a given + * store namespace. + * + * If configuration for that store namespace exists, it merges the new + * provided configuration with the existing one. + * + * @since 6.5.0 + * + * @param string $store_namespace The unique store namespace identifier. + * @param array $config Optional. The array that will be merged with the existing configuration for the + * specified store namespace. + * @return array The configuration for the specified store namespace. This will be the updated configuration if a + * $config argument was provided. + */ + function wp_interactivity_config(string $store_namespace, array $config = array()) : array + { + } + /** + * Generates a `data-wp-context` directive attribute by encoding a context + * array. + * + * This helper function simplifies the creation of `data-wp-context` directives + * by providing a way to pass an array of data, which encodes into a JSON string + * safe for direct use as a HTML attribute value. + * + * Example: + * + *
true, 'count' => 0 ) ); ?>> + * + * @since 6.5.0 + * + * @param array $context The array of context data to encode. + * @param string $store_namespace Optional. The unique store namespace identifier. + * @return string A complete `data-wp-context` directive with a JSON encoded value representing the context array and + * the store namespace if specified. + */ + function wp_interactivity_data_wp_context(array $context, string $store_namespace = '') : string + { + } function get_file($path) { } @@ -113093,6 +117653,7 @@ function kses_init() * @since 6.3.0 Extended support for `filter` to accept a URL and added support for repeat(). * Added support for `box-shadow`. * @since 6.4.0 Added support for `writing-mode`. + * @since 6.5.0 Added support for `background-repeat`. * * @param string $css A string of CSS rules. * @param string $deprecated Not used. @@ -113805,17 +118366,20 @@ function translate_user_role($name, $domain = 'default') { } /** - * Gets all available languages based on the presence of *.mo files in a given directory. + * Gets all available languages based on the presence of *.mo and *.l10n.php files in a given directory. * * The default directory is WP_LANG_DIR. * * @since 3.0.0 * @since 4.7.0 The results are now filterable with the {@see 'get_available_languages'} filter. + * @since 6.5.0 The initial file list is now cached and also takes into account *.l10n.php files. + * + * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. * * @param string $dir A directory to search for language files. * Default WP_LANG_DIR. * @return string[] An array of language codes or an empty array if no languages are present. - * Language codes are formed by stripping the .mo extension from the language file names. + * Language codes are formed by stripping the file extension from the language file names. */ function get_available_languages($dir = \null) { @@ -115976,7 +120540,7 @@ function get_the_privacy_policy_link($before = '', $after = '') * By default the list of internal hosts is comprised of the host name of * the site's home_url() (as parsed by wp_parse_url()). * - * This list is used when determining if a specificed URL is a link to a page on + * This list is used when determining if a specified URL is a link to a page on * the site itself or a link offsite (to an external host). This is used, for * example, when determining if the "nofollow" attribute should be applied to a * link. @@ -116352,6 +120916,8 @@ function wp_get_active_and_valid_plugins() * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_plugins + * * @param string[] $plugins Array of absolute plugin main file paths. * @return string[] Filtered array of plugins, without any paused plugins. */ @@ -116366,7 +120932,9 @@ function wp_skip_paused_plugins(array $plugins) * @since 5.1.0 * @access private * - * @global string $pagenow The filename of the current screen. + * @global string $pagenow The filename of the current screen. + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. * * @return string[] Array of absolute paths to theme directories. */ @@ -116378,6 +120946,8 @@ function wp_get_active_and_valid_themes() * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string[] $themes Array of absolute theme directory paths. * @return string[] Filtered array of absolute paths to themes, without any paused themes. */ @@ -117033,7 +121603,7 @@ function set_post_thumbnail_size($width = 0, $height = 0, $crop = \false) * @param string $align Part of the class name for aligning the image. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. - * @return string HTML IMG element for given image attachment? + * @return string HTML IMG element for given image attachment. */ function get_image_tag($id, $alt, $title, $align, $size = 'medium') { @@ -117340,7 +121910,7 @@ function _wp_get_image_size_from_meta($size_name, $image_meta) * @param int $attachment_id Image attachment ID. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @return string|false A 'srcset' value string or false. */ @@ -117380,7 +121950,7 @@ function wp_calculate_image_srcset($size_array, $image_src, $image_meta, $attach * @param int $attachment_id Image attachment ID. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @return string|false A valid source size value for use in a 'sizes' attribute or false. */ @@ -117394,8 +121964,8 @@ function wp_get_attachment_image_sizes($attachment_id, $size = 'medium', $image_ * * @param string|int[] $size Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). - * @param string $image_src Optional. The URL to the image file. Default null. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param string|null $image_src Optional. The URL to the image file. Default null. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` * is needed when using the image size name as argument for `$size`. Default 0. @@ -118430,6 +123000,7 @@ function wp_show_heic_upload_error($plupload_settings) * * @since 5.7.0 * @since 5.8.0 Added support for WebP images. + * @since 6.5.0 Added support for AVIF images. * * @param string $filename The file path. * @param array $image_info Optional. Extended image information (passed by reference). @@ -118438,6 +123009,24 @@ function wp_show_heic_upload_error($plupload_settings) function wp_getimagesize($filename, array &$image_info = \null) { } + /** + * Extracts meta information about an AVIF file: width, height, bit depth, and number of channels. + * + * @since 6.5.0 + * + * @param string $filename Path to an AVIF file. + * @return array { + * 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. + * } + */ + function wp_get_avif_info($filename) + { + } /** * Extracts meta information about a WebP file: width, height, and type. * @@ -119200,8 +123789,7 @@ function update_blog_option($id, $option, $value, $deprecated = \null) * This function is useful if you need to pull posts, or other information, * from other blogs. You can switch back afterwards using restore_current_blog(). * - * Things that aren't switched: - * - plugins. See #14941 + * PHP code loaded with the originally requested site, such as code from a plugin or theme, does not switch. See #14941. * * @see restore_current_blog() * @since MU (3.0.0) @@ -120463,8 +125051,6 @@ function redirect_this_site($deprecated = '') * * @since MU (3.0.0) * - * @blessed - * * @param array $upload An array of information about the newly-uploaded file. * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message. */ @@ -121745,7 +126331,7 @@ function _nav_menu_item_id_use_once($id, $item) * WordPress 3.0.0 so this needs to allow for cases in which the filter is * called without them. * - * @see https://core.trac.wordpress.org/ticket/56926. + * @see https://core.trac.wordpress.org/ticket/56926 * * @since 6.2.0 * @@ -122239,7 +126825,7 @@ function get_option($option, $default_value = \false) * * @global wpdb $wpdb WordPress database abstraction object. * - * @param array $options An array of option names to be loaded. + * @param string[] $options An array of option names to be loaded. * @phpstan-return void */ function wp_prime_option_caches($options) @@ -122264,7 +126850,7 @@ function wp_prime_option_caches_by_group($option_group) * * @since 6.4.0 * - * @param array $options An array of option names to retrieve. + * @param string[] $options An array of option names to retrieve. * @return array An array of key-value pairs for the requested options. */ function get_options($options) @@ -122301,7 +126887,7 @@ function wp_set_option_autoload_values(array $options) * * @see wp_set_option_autoload_values() * - * @param array $options List of option names. Expected to not be SQL-escaped. + * @param string[] $options List of option names. Expected to not be SQL-escaped. * @param string|bool $autoload Autoload value to control whether to load the options when WordPress starts up. * Accepts 'yes'|true to enable or 'no'|false to disable. * @return array Associative array of all provided $options as keys and boolean values for whether their autoload value @@ -123322,9 +127908,9 @@ function check_ajax_referer($action = -1, $query_arg = \false, $stop = \true) * * @global bool $is_IIS * - * @param string $location The path or URL to redirect to. - * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). - * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'. + * @param string $location The path or URL to redirect to. + * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). + * @param string|false $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'. * @return bool False if the redirect was canceled, true otherwise. */ function wp_redirect($location, $status = 302, $x_redirect_by = 'WordPress') @@ -123383,9 +127969,9 @@ function _wp_sanitize_utf8_in_redirect($matches) * @since 2.3.0 * @since 5.1.0 The return value from wp_redirect() is now passed on, and the `$x_redirect_by` parameter was added. * - * @param string $location The path or URL to redirect to. - * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). - * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'. + * @param string $location The path or URL to redirect to. + * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). + * @param string|false $x_redirect_by Optional. The application doing the redirect or false to omit. Default 'WordPress'. * @return bool False if the redirect was canceled, true otherwise. */ function wp_safe_redirect($location, $status = 302, $x_redirect_by = 'WordPress') @@ -123566,7 +128152,7 @@ function wp_hash($data, $scheme = 'auth') * * @since 2.5.0 * - * @global PasswordHash $wp_hasher PHPass object + * @global PasswordHash $wp_hasher PHPass object. * * @param string $password Plain text user password to hash. * @return string The hash string of the password. @@ -125929,12 +130515,13 @@ function get_post_type_object($post_type) * * @param array|string $args Optional. An array of key => value arguments to match against * the post type objects. Default empty array. - * @param string $output Optional. The type of output to return. Accepts post type 'names' + * @param string $output Optional. The type of output to return. Either 'names' * or 'objects'. Default 'names'. * @param string $operator Optional. The logical operation to perform. 'or' means only one * element from the array needs to match; 'and' means all elements * must match; 'not' means no elements may match. Default 'and'. * @return string[]|WP_Post_Type[] An array of post type names or objects. + * @phpstan-param 'names'|'objects' $output * @phpstan-return ($output is 'names' ? array : array) */ function get_post_types($args = array(), $output = 'names', $operator = 'and') @@ -126014,7 +130601,8 @@ function get_post_types($args = array(), $output = 'names', $operator = 'and') * @type string $rest_controller_class REST API controller class name. Default is 'WP_REST_Posts_Controller'. * @type string|bool $autosave_rest_controller_class REST API controller class name. Default is 'WP_REST_Autosaves_Controller'. * @type string|bool $revisions_rest_controller_class REST API controller class name. Default is 'WP_REST_Revisions_Controller'. - * @type bool $late_route_registration A flag to direct the REST API controllers for autosave / revisions should be registered before/after the post type controller. + * @type bool $late_route_registration A flag to direct the REST API controllers for autosave / revisions + * should be registered before/after the post type controller. * @type int $menu_position The position in the menu order the post type should appear. To work, * $show_in_menu must be true. Default null (at the bottom). * @type string $menu_icon The URL to the icon to be used for this menu. Pass a base64-encoded @@ -126032,7 +130620,7 @@ function get_post_types($args = array(), $output = 'names', $operator = 'and') * See get_post_type_capabilities(). * @type bool $map_meta_cap Whether to use the internal default meta capability handling. * Default false. - * @type array $supports Core feature(s) the post type supports. Serves as an alias for calling + * @type array|false $supports Core feature(s) the post type supports. Serves as an alias for calling * add_post_type_support() directly. Core features include 'title', * 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', * 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'. @@ -126042,6 +130630,7 @@ function get_post_types($args = array(), $output = 'names', $operator = 'and') * specified as an array of arguments to provide additional information * about supporting that feature. * Example: `array( 'my_feature', array( 'field' => 'value' ) )`. + * If false, no features will be added. * Default is an array containing 'title' and 'editor'. * @type callable $register_meta_box_cb Provide a callback function that sets up the meta boxes for the * edit form. Do remove_meta_box() and add_meta_box() calls in the @@ -126121,7 +130710,7 @@ function get_post_types($args = array(), $output = 'names', $operator = 'and') * capability_type?: string|array, * capabilities?: string[], * map_meta_cap?: bool, - * supports?: array, + * supports?: array|false, * register_meta_box_cb?: callable, * taxonomies?: string[], * has_archive?: bool|string, @@ -127998,10 +132587,9 @@ function wp_get_attachment_thumb_url($post_id = 0) * * @since 4.2.0 * - * @param string $type Attachment type. Accepts 'image', 'audio', or 'video'. + * @param string $type Attachment type. Accepts `image`, `audio`, `video`, or a file extension. * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post. - * @return bool True if one of the accepted types, false otherwise. - * @phpstan-param 'image'|'audio'|'video' $type + * @return bool True if an accepted type or a matching file extension, false otherwise. */ function wp_attachment_is($type, $post = \null) { @@ -128027,11 +132615,13 @@ function wp_attachment_is_image($post = \null) * Retrieves the icon for a MIME type or attachment. * * @since 2.1.0 + * @since 6.5.0 Added the `$preferred_ext` parameter. * - * @param string|int $mime MIME type or attachment ID. + * @param string|int $mime MIME type or attachment ID. + * @param string $preferred_ext File format to prefer in return. Default '.png'. * @return string|false Icon, false otherwise. */ - function wp_mime_type_icon($mime = 0) + function wp_mime_type_icon($mime = 0, $preferred_ext = '.png') { } /** @@ -129693,7 +134283,7 @@ function _rest_array_intersect_key_recursive($array1, $array2) { } /** - * Filters the REST API response to include only a white-listed set of response object fields. + * Filters the REST API response to include only an allow-listed set of response object fields. * * @since 4.8.0 * @@ -130488,6 +135078,20 @@ function rest_get_endpoint_args_for_schema($schema, $method = \WP_REST_Server::C function rest_convert_error_to_response($error) { } + /** + * Checks whether a REST API endpoint request is currently being handled. + * + * This may be a standalone REST API request, or an internal request dispatched from within a regular page load. + * + * @since 6.5.0 + * + * @global WP_REST_Server $wp_rest_server REST server instance. + * + * @return bool True if a REST endpoint request is currently being handled, false otherwise. + */ + function wp_is_rest_endpoint() + { + } /** * Post revision functions. * @@ -131404,6 +136008,8 @@ function wp_prototype_before_jquery($js_array) * These localizations require information that may not be loaded even by init. * * @since 2.5.0 + * + * @global array $shortcode_tags */ function wp_just_in_time_script_localization() { @@ -131756,32 +136362,32 @@ function wp_print_script_tag($attributes) { } /** - * Wraps inline JavaScript in `" from - * around an inline script after trimming whitespace. Typlically this + * around an inline script after trimming whitespace. Typically this * is used in conjunction with output buffering, where `ob_get_clean()` * is passed as the `$contents` argument. * @@ -131939,8 +136545,8 @@ function wp_add_editor_classic_theme_styles($editor_settings) * $js = ''; * 'console.error( ... )' === wp_remove_surrounding_empty_script_tags( $js ); * - * @private * @since 6.4.0 + * @access private * * @see wp_print_inline_script_tag() * @see wp_get_inline_script_tag() @@ -131952,6 +136558,127 @@ function wp_add_editor_classic_theme_styles($editor_settings) function wp_remove_surrounding_empty_script_tags($contents) { } + /** + * Script Modules API: Script Module functions + * + * @since 6.5.0 + * + * @package WordPress + * @subpackage Script Modules + */ + /** + * Retrieves the main WP_Script_Modules instance. + * + * 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 + * + * @return WP_Script_Modules The main WP_Script_Modules instance. + */ + function wp_script_modules() : \WP_Script_Modules + { + } + /** + * Registers the script module if no script module with that script module + * identifier has already been registered. + * + * @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. + * @phpstan-param array $deps + */ + function wp_register_script_module(string $id, string $src, array $deps = array(), $version = \false) + { + } + /** + * Marks the script module to be enqueued in the page. + * + * If a src is provided and the script module has not been registered yet, it + * will be registered. + * + * @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. + * @phpstan-param array $deps + */ + function wp_enqueue_script_module(string $id, string $src = '', array $deps = array(), $version = \false) + { + } + /** + * Unmarks the script module so it is no longer enqueued in the page. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ + function wp_dequeue_script_module(string $id) + { + } + /** + * Deregisters the script module. + * + * @since 6.5.0 + * + * @param string $id The identifier of the script module. + */ + function wp_deregister_script_module(string $id) + { + } /** * Adds a new shortcode. * @@ -132138,7 +136865,7 @@ function get_shortcode_regex($tagnames = \null) * @type string $3 Shortcode arguments list. * @type string $4 Optional self closing slash. * @type string $5 Content of a shortcode when it wraps some content. - * @type string $6 Optional second closing brocket for escaping shortcodes. + * @type string $6 Optional second closing bracket for escaping shortcodes. * } * @return string Shortcode output. * @phpstan-param array{ @@ -132201,11 +136928,13 @@ function get_shortcode_atts_regex() * retrieval of the attributes, since all attributes have to be known. * * @since 2.5.0 + * @since 6.5.0 The function now always returns an empty array, + * even if the original arguments string cannot be parsed or is empty. * * @param string $text Shortcode arguments list. - * @return array|string Array of attribute values keyed by attribute name. - * Returns empty array if there are no attributes. - * Returns the original arguments string if it cannot be parsed. + * @return array Array of attribute values keyed by attribute name. + * Returns empty array if there are no attributes + * or if the original arguments string cannot be parsed. */ function shortcode_parse_atts($text) { @@ -132509,12 +137238,13 @@ function create_initial_taxonomies() * * @param array $args Optional. An array of `key => value` arguments to match against the taxonomy objects. * Default empty array. - * @param string $output Optional. The type of output to return in the array. Accepts either taxonomy 'names' + * @param string $output Optional. The type of output to return in the array. Either 'names' * or 'objects'. Default 'names'. * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only * one element from the array needs to match; 'and' means all elements must match. * Default 'and'. * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects. + * @phpstan-param 'names'|'objects' $output * @phpstan-param 'and'|'or' $operator * @phpstan-return ($output is 'names' ? array : array) */ @@ -134780,13 +139510,22 @@ function get_singular_template() * * @see get_query_template() * - * @global array $posts - * * @return string Full path to attachment template file. */ function get_attachment_template() { } + /** + * Set up the globals used for template loading. + * + * @since 6.5.0 + * + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. + */ + function wp_set_template_globals() + { + } /** * Retrieves the name of the highest priority template file that exists. * @@ -134797,6 +139536,9 @@ function get_attachment_template() * @since 2.7.0 * @since 5.5.0 The `$args` parameter was added. * + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. + * * @param string|array $template_names Template file(s) to search for, in order. * @param bool $load If true the template file will be loaded if it is found. * @param bool $load_once Whether to require_once or require. Has no effect if `$load` is false. @@ -134870,10 +139612,10 @@ function wp_attach_theme_preview_middleware() * Sets the JavaScript global WP_BLOCK_THEME_ACTIVATE_NONCE containing the nonce * required to activate a theme. For use within the site editor. * - * @see https://github.com/WordPress/gutenberg/pull/41836. + * @see https://github.com/WordPress/gutenberg/pull/41836 * * @since 6.3.0 - * @private + * @access private */ function wp_block_theme_activate_nonce() { @@ -135010,6 +139752,10 @@ function wp_clean_themes_cache($clear_update_cache = \true) * Whether a child theme is in use. * * @since 3.0.0 + * @since 6.5.0 Makes use of global template variables. + * + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. * * @return bool True if a child theme is in use, false otherwise. */ @@ -135787,18 +140533,31 @@ function get_theme_starter_content() * @since 5.3.0 The `html5` feature now also accepts 'script' and 'style'. * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. + * @since 5.4.0 The `disable-custom-gradients` feature limits to default gradients or gradients added + * through `editor-gradient-presets` theme support. * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default. * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'. * @since 5.6.0 The `post-formats` feature warns if no array is passed as the second parameter. * @since 5.8.0 The `widgets-block-editor` feature enables the Widgets block editor. + * @since 5.8.0 The `block-templates` feature indicates whether a theme uses block-based templates. * @since 6.0.0 The `html5` feature warns if no array is passed as the second parameter. + * @since 6.1.0 The `block-template-parts` feature allows to edit any reusable template part from site editor. + * @since 6.1.0 The `disable-layout-styles` feature disables the default layout styles. + * @since 6.3.0 The `link-color` feature allows to enable the link color setting. + * @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. * * @global array $_wp_theme_features * * @param string $feature The feature being added. Likely core values include: * - 'admin-bar' * - 'align-wide' + * - 'appearance-tools' * - 'automatic-feed-links' + * - 'block-templates' + * - 'block-template-parts' + * - 'border' * - 'core-block-patterns' * - 'custom-background' * - 'custom-header' @@ -135810,21 +140569,24 @@ function get_theme_starter_content() * - 'dark-editor-style' * - 'disable-custom-colors' * - 'disable-custom-font-sizes' + * - 'disable-custom-gradients' + * - 'disable-layout-styles' * - 'editor-color-palette' * - 'editor-gradient-presets' * - 'editor-font-sizes' * - 'editor-styles' * - 'featured-content' * - 'html5' + * - 'link-color' * - 'menus' * - 'post-formats' * - 'post-thumbnails' * - 'responsive-embeds' * - 'starter-content' * - 'title-tag' - * - 'wp-block-styles' * - 'widgets' * - 'widgets-block-editor' + * - 'wp-block-styles' * @param mixed ...$args Optional extra arguments to pass along with certain features. * @return void|false Void on success, false on failure. */ @@ -136072,7 +140834,6 @@ function _wp_customize_include() * @since 4.7.0 * @access private * - * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Customize_Manager $wp_customize Customizer instance. * * @param string $new_status New post status. @@ -137384,7 +142145,7 @@ function wp_get_password_hint() * * @since 4.4.0 * - * @global PasswordHash $wp_hasher Portable PHP password hashing framework. + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param WP_User $user User to retrieve password reset key for. * @return string|WP_Error Password reset key on success. WP_Error on error. @@ -137417,8 +142178,8 @@ function check_password_reset_key($key, $login) * @since 2.5.0 * @since 5.7.0 Added `$user_login` parameter. * - * @global wpdb $wpdb WordPress database abstraction object. - * @global PasswordHash $wp_hasher Portable PHP password hashing framework. + * @global wpdb $wpdb WordPress database abstraction object. + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param string $user_login Optional. Username to send a password retrieval email for. * Defaults to `$_POST['user_login']` if not set. @@ -137715,6 +142476,8 @@ function wp_send_user_request($request_id) * * @since 4.9.6 * + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. + * * @param int $request_id Request ID. * @return string Confirmation key. */ @@ -137726,6 +142489,8 @@ function wp_generate_user_request_key($request_id) * * @since 4.9.6 * + * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. + * * @param string $request_id ID of the request being confirmed. * @param string $key Provided key to validate. * @return true|WP_Error True on success, WP_Error on failure. @@ -137819,7 +142584,7 @@ function wp_is_password_reset_allowed_for_user($user) { } /** - * Test if the current browser runs on a mobile device (smart phone, tablet, etc.) + * Test if the current browser runs on a mobile device (smart phone, tablet, etc.). * * @since 3.4.0 * @since 6.4.0 Added checking for the Sec-CH-UA-Mobile request header. @@ -137921,7 +142686,7 @@ function register_sidebars($number = 1, $args = array()) * @since 5.6.0 Added the `before_sidebar` and `after_sidebar` arguments. * @since 5.9.0 Added the `show_in_rest` argument. * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * * @param array|string $args { * Optional. Array or string of arguments for the sidebar being registered. @@ -137976,7 +142741,7 @@ function register_sidebar($args = array()) * * @since 2.2.0 * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * * @param string|int $sidebar_id The ID of the sidebar when it was registered. */ @@ -137988,7 +142753,7 @@ function unregister_sidebar($sidebar_id) * * @since 4.4.0 * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * * @param string|int $sidebar_id The ID of the sidebar when it was registered. * @return bool True if the sidebar is registered, false otherwise. @@ -138011,7 +142776,7 @@ function is_registered_sidebar($sidebar_id) * * @global array $wp_registered_widgets Uses stored registered widgets. * @global array $wp_registered_widget_controls Stores the registered widget controls (options). - * @global array $wp_registered_widget_updates + * @global array $wp_registered_widget_updates The registered widget updates. * @global array $_wp_deprecated_widgets_callbacks * * @param int|string $id Widget ID. @@ -138047,7 +142812,7 @@ function wp_register_sidebar_widget($id, $name, $output_callback, $options = arr * * @since 2.5.0 * - * @global array $wp_registered_widgets + * @global array $wp_registered_widgets The registered widgets. * * @param int|string $id Widget ID. * @return string|void Widget description, if available. @@ -138063,7 +142828,7 @@ function wp_widget_description($id) * * @since 2.9.0 * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * * @param string $id sidebar ID. * @return string|void Sidebar description, if available. @@ -138088,9 +142853,9 @@ function wp_unregister_sidebar_widget($id) * @since 5.3.0 Formalized the existing and already documented `...$params` parameter * by adding it to the function signature. * - * @global array $wp_registered_widget_controls - * @global array $wp_registered_widget_updates - * @global array $wp_registered_widgets + * @global array $wp_registered_widget_controls The registered widget controls. + * @global array $wp_registered_widget_updates The registered widget updates. + * @global array $wp_registered_widgets The registered widgets. * @global array $_wp_deprecated_widgets_callbacks * * @param int|string $id Sidebar ID. @@ -138123,7 +142888,7 @@ function wp_register_widget_control($id, $name, $control_callback, $options = ar * @since 5.3.0 Formalized the existing and already documented `...$params` parameter * by adding it to the function signature. * - * @global array $wp_registered_widget_updates + * @global array $wp_registered_widget_updates The registered widget updates. * * @param string $id_base The base ID of a widget created by extending WP_Widget. * @param callable $update_callback Update callback method for the widget. @@ -138147,7 +142912,7 @@ function _register_widget_update_callback($id_base, $update_callback, $options = * @since 5.3.0 Formalized the existing and already documented `...$params` parameter * by adding it to the function signature. * - * @global array $wp_registered_widget_controls + * @global array $wp_registered_widget_controls The registered widget controls. * * @param int|string $id Widget ID. * @param string $name Name attribute for the widget. @@ -138184,8 +142949,8 @@ function wp_unregister_widget_control($id) * * @since 2.2.0 * - * @global array $wp_registered_sidebars Registered sidebars. - * @global array $wp_registered_widgets Registered widgets. + * @global array $wp_registered_sidebars The registered sidebars. + * @global array $wp_registered_widgets The registered widgets. * * @param int|string $index Optional. Index, name or ID of dynamic sidebar. Default 1. * @return bool True, if widget sidebar was found and called. False if not found or not called. @@ -138212,7 +142977,7 @@ function dynamic_sidebar($index = 1) * * @since 2.2.0 * - * @global array $wp_registered_widgets + * @global array $wp_registered_widgets The registered widgets. * * @param callable|false $callback Optional. Widget callback to check. Default false. * @param string|false $widget_id Optional. Widget ID. Optional, but needed for checking. @@ -138236,8 +143001,8 @@ function is_active_widget($callback = \false, $widget_id = \false, $id_base = \f * * @since 2.2.0 * - * @global array $wp_registered_widgets Registered widgets. - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_widgets The registered widgets. + * @global array $wp_registered_sidebars The registered sidebars. * * @return bool True if using widgets, false otherwise. */ @@ -138311,7 +143076,7 @@ function wp_set_sidebars_widgets($sidebars_widgets) * @since 2.2.0 * @access private * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * * @return array */ @@ -138402,9 +143167,9 @@ function _wp_sidebars_changed() * * @since 2.8.0 * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * @global array $sidebars_widgets - * @global array $wp_registered_widgets Registered widgets. + * @global array $wp_registered_widgets The registered widgets. * * @param string|bool $theme_changed Whether the theme was changed as a boolean. A value * of 'customize' defers updates for the Customizer. @@ -138419,6 +143184,8 @@ function retrieve_widgets($theme_changed = \false) * @since 4.9.0 * @since 4.9.2 Always tries to restore widget assignments from previous data, not just if sidebars needed mapping. * + * @global array $wp_registered_sidebars The registered sidebars. + * * @param array $existing_sidebars_widgets List of sidebars and their widget instance IDs. * @return array Mapped sidebars widgets. */ @@ -138430,6 +143197,8 @@ function wp_map_sidebars_widgets($existing_sidebars_widgets) * * @since 4.9.0 * + * @global array $wp_registered_widgets The registered widgets. + * * @param array $sidebars_widgets List of sidebars and their widget instance IDs. * @param array $allowed_widget_ids Optional. List of widget IDs to compare against. Default: Registered widgets. * @return array Sidebars with allowed widgets. @@ -138558,6 +143327,9 @@ function wp_assign_widget_to_sidebar($widget_id, $sidebar_id) * * @since 5.8.0 * + * @global array $wp_registered_widgets The registered widgets. + * @global array $wp_registered_sidebars The registered sidebars. + * * @param string $widget_id Widget ID. * @param string $sidebar_id Sidebar ID. * @return string @@ -138570,6 +143342,8 @@ function wp_render_widget($widget_id, $sidebar_id) * * @since 5.8.0 * + * @global array $wp_registered_widget_controls The registered widget controls. + * * @param string $id Widget ID. * @return string|null */ @@ -138603,7 +143377,7 @@ function wp_check_widget_editor_deps() * @since 6.2.0 * @access private * - * @global array $wp_registered_sidebars Registered sidebars. + * @global array $wp_registered_sidebars The registered sidebars. * @phpstan-return void */ function _wp_block_theme_register_classic_sidebars() @@ -138871,10 +143645,13 @@ function trackback_response($error = 0, $error_message = '') /** * logIO() - Writes logging info to a file. * + * @since 1.2.0 * @deprecated 3.4.0 Use error_log() * @see error_log() * - * @param string $io Whether input or output + * @global int|bool $xmlrpc_logging Whether to enable XML-RPC logging. + * + * @param string $io Whether input or output. * @param string $msg Information describing logging reason. */ function logIO($io, $msg)