, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error
*/
public function request($url, $args = array())
@@ -39556,6 +40884,17 @@ public function save($destfilename = \null, $mime_type = \null)
protected function _save($image, $filename = \null, $mime_type = \null)
{
}
+ /**
+ * Sets Image Compression quality on a 1-100% scale. Handles WebP lossless images.
+ *
+ * @since 6.7.0
+ *
+ * @param int $quality Compression Quality. Range: [1,100]
+ * @return true|WP_Error True if set successfully; WP_Error on failure.
+ */
+ public function set_quality($quality = \null)
+ {
+ }
/**
* Returns stream of current image.
*
@@ -41411,7 +42750,7 @@ class WP_Object_Cache
*/
protected $global_groups = array();
/**
- * Sets up object properties; PHP 5 style constructor.
+ * Sets up object properties.
*
* @since 2.0.8
*/
@@ -41436,7 +42775,6 @@ public function __get($name)
*
* @param string $name Property to set.
* @param mixed $value Property value.
- * @return mixed Newly-set property.
*/
public function __set($name, $value)
{
@@ -46556,12 +47894,35 @@ 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()
{
}
+ /**
+ * Print data associated with Script Modules.
+ *
+ * The data will be embedded in the page HTML and can be read by Script Modules on page load.
+ *
+ * @since 6.7.0
+ *
+ * Data can be associated with a Script Module via the
+ * {@see "script_module_data_{$module_id}"} filter.
+ *
+ * The data for a Script Module will be serialized as JSON in a script tag with an ID of the
+ * form `wp-script-module-data-{$module_id}`.
+ */
+ public function print_script_module_data() : void
+ {
+ }
+ /**
+ * @access private This is only intended to be called by the registered actions.
+ *
+ * @since 6.7.0
+ * @phpstan-return void
+ */
+ public function print_a11y_script_module_html()
+ {
+ }
}
/**
* Core class used to register scripts.
@@ -47150,7 +48511,7 @@ public static function drop_sessions()
* @since 2.8.0
*/
#[\AllowDynamicProperties]
- class WP_SimplePie_File extends \SimplePie_File
+ class WP_SimplePie_File extends \SimplePie\File
{
/**
* Timeout.
@@ -47183,13 +48544,13 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = \nul
/**
* Core class used to implement SimplePie feed sanitization.
*
- * Extends the SimplePie_Sanitize class to use KSES, because
+ * Extends the SimplePie\Sanitize class to use KSES, because
* we cannot universally count on DOMDocument being available.
*
* @since 3.5.0
*/
#[\AllowDynamicProperties]
- class WP_SimplePie_Sanitize_KSES extends \SimplePie_Sanitize
+ class WP_SimplePie_Sanitize_KSES extends \SimplePie\Sanitize
{
/**
* WordPress SimplePie sanitization using KSES.
@@ -47472,8 +48833,8 @@ public function parse_query($query = '')
* @since 4.6.0
*
* @param string|array $query Array or URL query string of parameters.
- * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
- * or the number of sites when 'count' is passed as a query var.
+ * @return WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
+ * or the number of sites when 'count' is passed as a query var.
*/
public function query($query)
{
@@ -47485,8 +48846,8 @@ public function query($query)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
- * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
- * or the number of sites when 'count' is passed as a query var.
+ * @return WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
+ * or the number of sites when 'count' is passed as a query var.
*/
public function get_sites()
{
@@ -48701,8 +50062,6 @@ class WP_Term_Query
* - 'id=>slug' Returns an associative array of term slugs,
* keyed by term ID (`string[]`).
* Default 'all'.
- * @type bool $count Whether to return a term count. If true, will take precedence
- * over `$fields`. Default false.
* @type string|string[] $name Name or array of names to return term(s) for.
* Default empty.
* @type string|string[] $slug Slug or array of slugs to return term(s) for.
@@ -48759,7 +50118,6 @@ class WP_Term_Query
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -48805,7 +50163,6 @@ public function __construct($query = '')
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -48843,7 +50200,7 @@ public function parse_query($query = '')
*
* @param string|array $query Array or URL query string of parameters.
* @return WP_Term[]|int[]|string[]|string Array of terms, or number of terms as numeric string
- * when 'count' is passed as a query var.
+ * when 'count' is passed to `$args['fields']`.
*/
public function query($query)
{
@@ -48883,7 +50240,7 @@ public function query($query)
* @global wpdb $wpdb WordPress database abstraction object.
*
* @return WP_Term[]|int[]|string[]|string Array of terms, or number of terms as numeric string
- * when 'count' is passed as a query var.
+ * when 'count' is passed to `$args['fields']`.
*/
public function get_terms()
{
@@ -49986,6 +51343,7 @@ public static function get_style_variations($scope = 'theme')
* as the value of `_link` object in REST API responses.
*
* @since 6.6.0
+ * @since 6.7.0 Resolve relative paths in block styles.
*
* @param WP_Theme_JSON $theme_json A theme json instance.
* @return array An array of resolved paths.
@@ -50180,10 +51538,11 @@ class WP_Theme_JSON
* @since 6.4.0 Added `writing-mode` property.
* @since 6.5.0 Added `aspect-ratio` property.
* @since 6.6.0 Added `background-[image|position|repeat|size]` properties.
+ * @since 6.7.0 Added `background-attachment` property.
*
* @var array
*/
- const PROPERTIES_METADATA = array('aspect-ratio' => array('dimensions', 'aspectRatio'), 'background' => array('color', 'gradient'), 'background-color' => array('color', 'background'), 'background-image' => array('background', 'backgroundImage'), 'background-position' => array('background', 'backgroundPosition'), 'background-repeat' => array('background', 'backgroundRepeat'), 'background-size' => array('background', 'backgroundSize'), 'border-radius' => array('border', 'radius'), 'border-top-left-radius' => array('border', 'radius', 'topLeft'), 'border-top-right-radius' => array('border', 'radius', 'topRight'), 'border-bottom-left-radius' => array('border', 'radius', 'bottomLeft'), 'border-bottom-right-radius' => array('border', 'radius', 'bottomRight'), 'border-color' => array('border', 'color'), 'border-width' => array('border', 'width'), 'border-style' => array('border', 'style'), 'border-top-color' => array('border', 'top', 'color'), 'border-top-width' => array('border', 'top', 'width'), 'border-top-style' => array('border', 'top', 'style'), 'border-right-color' => array('border', 'right', 'color'), 'border-right-width' => array('border', 'right', 'width'), 'border-right-style' => array('border', 'right', 'style'), 'border-bottom-color' => array('border', 'bottom', 'color'), 'border-bottom-width' => array('border', 'bottom', 'width'), 'border-bottom-style' => array('border', 'bottom', 'style'), 'border-left-color' => array('border', 'left', 'color'), 'border-left-width' => array('border', 'left', 'width'), 'border-left-style' => array('border', 'left', 'style'), 'color' => array('color', 'text'), 'text-align' => array('typography', 'textAlign'), 'column-count' => array('typography', 'textColumns'), 'font-family' => array('typography', 'fontFamily'), 'font-size' => array('typography', 'fontSize'), 'font-style' => array('typography', 'fontStyle'), 'font-weight' => array('typography', 'fontWeight'), 'letter-spacing' => array('typography', 'letterSpacing'), 'line-height' => array('typography', 'lineHeight'), 'margin' => array('spacing', 'margin'), 'margin-top' => array('spacing', 'margin', 'top'), 'margin-right' => array('spacing', 'margin', 'right'), 'margin-bottom' => array('spacing', 'margin', 'bottom'), 'margin-left' => array('spacing', 'margin', 'left'), 'min-height' => array('dimensions', 'minHeight'), 'outline-color' => array('outline', 'color'), 'outline-offset' => array('outline', 'offset'), 'outline-style' => array('outline', 'style'), 'outline-width' => array('outline', 'width'), 'padding' => array('spacing', 'padding'), 'padding-top' => array('spacing', 'padding', 'top'), 'padding-right' => array('spacing', 'padding', 'right'), 'padding-bottom' => array('spacing', 'padding', 'bottom'), 'padding-left' => array('spacing', 'padding', 'left'), '--wp--style--root--padding' => array('spacing', 'padding'), '--wp--style--root--padding-top' => array('spacing', 'padding', 'top'), '--wp--style--root--padding-right' => array('spacing', 'padding', 'right'), '--wp--style--root--padding-bottom' => array('spacing', 'padding', 'bottom'), '--wp--style--root--padding-left' => array('spacing', 'padding', 'left'), 'text-decoration' => array('typography', 'textDecoration'), 'text-transform' => array('typography', 'textTransform'), 'filter' => array('filter', 'duotone'), 'box-shadow' => array('shadow'), 'writing-mode' => array('typography', 'writingMode'));
+ const PROPERTIES_METADATA = array('aspect-ratio' => array('dimensions', 'aspectRatio'), 'background' => array('color', 'gradient'), 'background-color' => array('color', 'background'), 'background-image' => array('background', 'backgroundImage'), 'background-position' => array('background', 'backgroundPosition'), 'background-repeat' => array('background', 'backgroundRepeat'), 'background-size' => array('background', 'backgroundSize'), 'background-attachment' => array('background', 'backgroundAttachment'), 'border-radius' => array('border', 'radius'), 'border-top-left-radius' => array('border', 'radius', 'topLeft'), 'border-top-right-radius' => array('border', 'radius', 'topRight'), 'border-bottom-left-radius' => array('border', 'radius', 'bottomLeft'), 'border-bottom-right-radius' => array('border', 'radius', 'bottomRight'), 'border-color' => array('border', 'color'), 'border-width' => array('border', 'width'), 'border-style' => array('border', 'style'), 'border-top-color' => array('border', 'top', 'color'), 'border-top-width' => array('border', 'top', 'width'), 'border-top-style' => array('border', 'top', 'style'), 'border-right-color' => array('border', 'right', 'color'), 'border-right-width' => array('border', 'right', 'width'), 'border-right-style' => array('border', 'right', 'style'), 'border-bottom-color' => array('border', 'bottom', 'color'), 'border-bottom-width' => array('border', 'bottom', 'width'), 'border-bottom-style' => array('border', 'bottom', 'style'), 'border-left-color' => array('border', 'left', 'color'), 'border-left-width' => array('border', 'left', 'width'), 'border-left-style' => array('border', 'left', 'style'), 'color' => array('color', 'text'), 'text-align' => array('typography', 'textAlign'), 'column-count' => array('typography', 'textColumns'), 'font-family' => array('typography', 'fontFamily'), 'font-size' => array('typography', 'fontSize'), 'font-style' => array('typography', 'fontStyle'), 'font-weight' => array('typography', 'fontWeight'), 'letter-spacing' => array('typography', 'letterSpacing'), 'line-height' => array('typography', 'lineHeight'), 'margin' => array('spacing', 'margin'), 'margin-top' => array('spacing', 'margin', 'top'), 'margin-right' => array('spacing', 'margin', 'right'), 'margin-bottom' => array('spacing', 'margin', 'bottom'), 'margin-left' => array('spacing', 'margin', 'left'), 'min-height' => array('dimensions', 'minHeight'), 'outline-color' => array('outline', 'color'), 'outline-offset' => array('outline', 'offset'), 'outline-style' => array('outline', 'style'), 'outline-width' => array('outline', 'width'), 'padding' => array('spacing', 'padding'), 'padding-top' => array('spacing', 'padding', 'top'), 'padding-right' => array('spacing', 'padding', 'right'), 'padding-bottom' => array('spacing', 'padding', 'bottom'), 'padding-left' => array('spacing', 'padding', 'left'), '--wp--style--root--padding' => array('spacing', 'padding'), '--wp--style--root--padding-top' => array('spacing', 'padding', 'top'), '--wp--style--root--padding-right' => array('spacing', 'padding', 'right'), '--wp--style--root--padding-bottom' => array('spacing', 'padding', 'bottom'), '--wp--style--root--padding-left' => array('spacing', 'padding', 'left'), 'text-decoration' => array('typography', 'textDecoration'), 'text-transform' => array('typography', 'textTransform'), 'filter' => array('filter', 'duotone'), 'box-shadow' => array('shadow'), 'writing-mode' => array('typography', 'writingMode'));
/**
* Indirect metadata for style properties that are not directly output.
*
@@ -50269,7 +51628,7 @@ class WP_Theme_JSON
*
* @var array
*/
- const VALID_STYLES = array('background' => array('backgroundImage' => 'top', 'backgroundPosition' => 'top', 'backgroundRepeat' => 'top', 'backgroundSize' => 'top'), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null, 'top' => \null, 'right' => \null, 'bottom' => \null, 'left' => \null), 'color' => array('background' => \null, 'gradient' => \null, 'text' => \null), 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'filter' => array('duotone' => \null), 'outline' => array('color' => \null, 'offset' => \null, 'style' => \null, 'width' => \null), 'shadow' => \null, 'spacing' => array('margin' => \null, 'padding' => \null, 'blockGap' => \null), 'typography' => array('fontFamily' => \null, 'fontSize' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null), 'css' => \null);
+ const VALID_STYLES = array('background' => array('backgroundImage' => \null, 'backgroundPosition' => \null, 'backgroundRepeat' => \null, 'backgroundSize' => \null, 'backgroundAttachment' => \null), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null, 'top' => \null, 'right' => \null, 'bottom' => \null, 'left' => \null), 'color' => array('background' => \null, 'gradient' => \null, 'text' => \null), 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'filter' => array('duotone' => \null), 'outline' => array('color' => \null, 'offset' => \null, 'style' => \null, 'width' => \null), 'shadow' => \null, 'spacing' => array('margin' => \null, 'padding' => \null, 'blockGap' => \null), 'typography' => array('fontFamily' => \null, 'fontSize' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null), 'css' => \null);
/**
* Defines which pseudo selectors are enabled for which elements.
*
@@ -50600,6 +51959,7 @@ protected function process_blocks_custom_css($css, $selector)
* Returns the global styles custom CSS.
*
* @since 6.2.0
+ * @deprecated 6.7.0 Use {@see 'get_stylesheet'} instead.
*
* @return string The global styles custom CSS.
*/
@@ -50936,7 +52296,7 @@ protected static function flatten_tree($tree, $prefix = '', $token = '--')
*
* array(
* 'name' => 'property_name',
- * 'value' => 'property_value,
+ * 'value' => 'property_value',
* )
*
* @since 5.8.0
@@ -50944,6 +52304,7 @@ protected static function flatten_tree($tree, $prefix = '', $token = '--')
* @since 6.1.0 Added `$theme_json`, `$selector`, and `$use_root_padding` parameters.
* @since 6.5.0 Output a `min-height: unset` rule when `aspect-ratio` is set.
* @since 6.6.0 Pass current theme JSON settings to wp_get_typography_font_size_value(), and process background properties.
+ * @since 6.7.0 `ref` resolution of background properties, and assigning custom default values.
*
* @param array $styles Styles to process.
* @param array $settings Theme settings.
@@ -50970,6 +52331,7 @@ protected static function compute_style_properties($styles, $settings = array(),
* to the standard form "--wp--preset--color--secondary".
* This is already done by the sanitize method,
* so every property will be in the standard form.
+ * @since 6.7.0 Added support for background image refs.
*
* @param array $styles Styles subtree.
* @param array $path Which property to process.
@@ -51106,6 +52468,7 @@ protected static function get_metadata_boolean($data, $path, $default_value = \f
*
* @since 5.8.0
* @since 5.9.0 Duotone preset also has origins.
+ * @since 6.7.0 Replace background image objects during merge.
*
* @param WP_Theme_JSON $incoming Data to merge.
*/
@@ -52113,7 +53476,7 @@ class WP_Token_Map
*
* @return WP_Token_Map|null Token map, unless unable to create it.
*/
- public static function from_array($mappings, $key_length = 2)
+ public static function from_array(array $mappings, int $key_length = 2) : ?\WP_Token_Map
{
}
/**
@@ -52146,7 +53509,7 @@ public static function from_array($mappings, $key_length = 2)
* small_mappings?: array,
* } $state
*/
- public static function from_precomputed_table($state)
+ public static function from_precomputed_table($state) : ?\WP_Token_Map
{
}
/**
@@ -52163,7 +53526,7 @@ public static function from_precomputed_table($state)
* @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'.
* @return bool Whether there's an entry for the given word in the map.
*/
- public function contains($word, $case_sensitivity = 'case-sensitive')
+ public function contains(string $word, string $case_sensitivity = 'case-sensitive') : bool
{
}
/**
@@ -52202,13 +53565,14 @@ public function contains($word, $case_sensitivity = 'case-sensitive')
*
* @since 6.6.0
*
- * @param string $text String in which to search for a lookup key.
- * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0.
- * @param ?int &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null.
- * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'.
+ * @param string $text String in which to search for a lookup key.
+ * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0.
+ * @param int|null &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null.
+ * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'.
+ *
* @return string|null Mapped value of lookup key if found, otherwise `null`.
*/
- public function read_token($text, $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive')
+ public function read_token(string $text, int $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive') : ?string
{
}
/**
@@ -52225,7 +53589,7 @@ public function read_token($text, $offset = 0, &$matched_token_byte_length = \nu
*
* @return array The lookup key/substitution values as an associate array.
*/
- public function to_array()
+ public function to_array() : array
{
}
/**
@@ -52256,7 +53620,7 @@ public function to_array()
* @param string $indent Optional. Use this string for indentation, or rely on the default horizontal tab character. Default "\t".
* @return string Value which can be pasted into a PHP source file for quick loading of table.
*/
- public function precomputed_php_source_table($indent = "\t")
+ public function precomputed_php_source_table(string $indent = "\t") : string
{
}
}
@@ -53547,7 +54911,7 @@ public function update($new_instance, $old_instance)
*
* @since 2.8.0
*
- * @param array $instance Current settings.
+ * @param array $instance The settings for the particular instance of the widget.
* @return string Default return is 'noform'.
* @phpstan-param T $instance
*/
@@ -58122,7 +59486,6 @@ public function close()
*
* @since 2.5.0
*
- * @global string $wp_version The WordPress version string.
* @global string $required_mysql_version The required MySQL version string.
* @return void|WP_Error
*/
@@ -61086,6 +62449,16 @@ class WP_Font_Face_Resolver
public static function get_fonts_from_theme_json()
{
}
+ /**
+ * Gets fonts defined in style variations.
+ *
+ * @since 6.7.0
+ *
+ * @return array Returns an array of font-families.
+ */
+ public static function get_fonts_from_style_variations()
+ {
+ }
}
/**
* Font Face generates and prints `@font-face` styles for given fonts.
@@ -61342,7 +62715,7 @@ class WP_HTML_Active_Formatting_Elements
* @param WP_HTML_Token $token Look for this node in the stack.
* @return bool Whether the referenced node is in the stack of active formatting elements.
*/
- public function contains_node($token)
+ public function contains_node(\WP_HTML_Token $token)
{
}
/**
@@ -61366,6 +62739,21 @@ public function count()
public function current_node()
{
}
+ /**
+ * Inserts a "marker" at the end of the list of active formatting elements.
+ *
+ * > The markers are inserted when entering applet, object, marquee,
+ * > template, td, th, and caption elements, and are used to prevent
+ * > formatting from "leaking" into applet, object, marquee, template,
+ * > td, th, and caption elements.
+ *
+ * @see https://html.spec.whatwg.org/#concept-parser-marker
+ *
+ * @since 6.7.0
+ */
+ public function insert_marker() : void
+ {
+ }
/**
* Pushes a node onto the stack of active formatting elements.
*
@@ -61375,7 +62763,7 @@ public function current_node()
*
* @param WP_HTML_Token $token Push this node onto the stack.
*/
- public function push($token)
+ public function push(\WP_HTML_Token $token)
{
}
/**
@@ -61386,7 +62774,7 @@ public function push($token)
* @param WP_HTML_Token $token Remove this node from the stack, if it's there already.
* @return bool Whether the node was found and removed from the stack of active formatting elements.
*/
- public function remove_node($token)
+ public function remove_node(\WP_HTML_Token $token)
{
}
/**
@@ -61433,6 +62821,26 @@ public function walk_down()
public function walk_up()
{
}
+ /**
+ * Clears the list of active formatting elements up to the last marker.
+ *
+ * > When the steps below require the UA to clear the list of active formatting elements up to
+ * > the last marker, the UA must perform the following steps:
+ * >
+ * > 1. Let entry be the last (most recently added) entry in the list of active
+ * > formatting elements.
+ * > 2. Remove entry from the list of active formatting elements.
+ * > 3. If entry was a marker, then stop the algorithm at this point.
+ * > The list has been cleared up to the last marker.
+ * > 4. Go to step 1.
+ *
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker
+ *
+ * @since 6.7.0
+ */
+ public function clear_up_to_last_marker() : void
+ {
+ }
}
/**
* Core class used by the HTML tag processor as a data structure for the attribute token,
@@ -61563,7 +62971,7 @@ class WP_HTML_Decoder
* Default 'case-sensitive'.
* @return bool Whether the attribute value starts with the given string.
*/
- public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive')
+ public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive') : bool
{
}
/**
@@ -61583,7 +62991,7 @@ public static function attribute_starts_with($haystack, $search_text, $case_sens
* @param string $text Text containing raw and non-decoded text node to decode.
* @return string Decoded UTF-8 value of given text node.
*/
- public static function decode_text_node($text)
+ public static function decode_text_node($text) : string
{
}
/**
@@ -61602,7 +63010,7 @@ public static function decode_text_node($text)
* @param string $text Text containing raw and non-decoded attribute value to decode.
* @return string Decoded UTF-8 value of given attribute value.
*/
- public static function decode_attribute($text)
+ public static function decode_attribute($text) : string
{
}
/**
@@ -61624,7 +63032,7 @@ public static function decode_attribute($text)
* @param string $text Text document containing span of text to decode.
* @return string Decoded UTF-8 string.
*/
- public static function decode($context, $text)
+ public static function decode($context, $text) : string
{
}
/**
@@ -61654,6 +63062,8 @@ public static function decode($context, $text)
*
* @since 6.6.0
*
+ * @global WP_Token_Map $html5_named_character_references Mappings for HTML5 named character references.
+ *
* @param string $context `attribute` for decoding attribute values, `data` otherwise.
* @param string $text Text document containing span of text to decode.
* @param int $at Optional. Byte offset into text where span begins, defaults to the beginning (0).
@@ -61685,7 +63095,186 @@ public static function read_character_reference($context, $text, $at = 0, &$matc
* @param int $code_point Which code point to convert.
* @return string Converted code point, or `�` if invalid.
*/
- public static function code_point_to_utf8_bytes($code_point)
+ public static function code_point_to_utf8_bytes($code_point) : string
+ {
+ }
+ }
+ /**
+ * Core class used by the HTML API to represent a DOCTYPE declaration.
+ *
+ * This class parses DOCTYPE tokens for the full parser in the HTML Processor.
+ * Most code interacting with HTML won't need to parse DOCTYPE declarations;
+ * the HTML Processor is one exception. Consult the HTML Processor for proper
+ * parsing of an HTML document.
+ *
+ * A DOCTYPE declaration may indicate its document compatibility mode, which impacts
+ * the structure of the following HTML as well as the behavior of CSS class selectors.
+ * There are three possible modes:
+ *
+ * - "no-quirks" and "limited-quirks" modes (also called "standards mode").
+ * - "quirks" mode.
+ *
+ * These modes mostly determine whether CSS class name selectors match values in the
+ * HTML `class` attribute in an ASCII-case-insensitive way (quirks mode), or whether
+ * they match only when byte-for-byte identical (no-quirks mode).
+ *
+ * All HTML documents should start with the standard HTML5 DOCTYPE: ``.
+ *
+ * > DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different
+ * > rendering mode that is incompatible with some specifications. Including the DOCTYPE in a
+ * > document ensures that the browser makes a best-effort attempt at following the
+ * > relevant specifications.
+ *
+ * @see https://html.spec.whatwg.org/#the-doctype
+ *
+ * DOCTYPE declarations comprise four properties: a name, public identifier, system identifier,
+ * and an indication of which document compatability mode they would imply if an HTML parser
+ * hadn't already determined it from other information.
+ *
+ * @see https://html.spec.whatwg.org/#the-initial-insertion-mode
+ *
+ * Historically, the DOCTYPE declaration was used in SGML documents to instruct a parser how
+ * to interpret the various tags and entities within a document. Its role in HTML diverged
+ * from how it was used in SGML and no meaning should be back-read into HTML based on how it
+ * is used in SGML, XML, or XHTML documents.
+ *
+ * @see https://www.iso.org/standard/16387.html
+ *
+ * @since 6.7.0
+ *
+ * @see WP_HTML_Processor
+ */
+ class WP_HTML_Doctype_Info
+ {
+ /**
+ * Name of the DOCTYPE: should be "html" for HTML documents.
+ *
+ * This value should be considered "read only" and not modified.
+ *
+ * Historically the DOCTYPE name indicates name of the document's root element.
+ *
+ *
+ * ╰──┴── name is "html".
+ *
+ * @see https://html.spec.whatwg.org/#tokenization
+ *
+ * @since 6.7.0
+ *
+ * @var string|null
+ */
+ public $name = \null;
+ /**
+ * Public identifier of the DOCTYPE.
+ *
+ * This value should be considered "read only" and not modified.
+ *
+ * The public identifier is optional and should not appear in HTML documents.
+ * A `null` value indicates that no public identifier was present in the DOCTYPE.
+ *
+ * Historically the presence of the public identifier indicated that a document
+ * was meant to be shared between computer systems and the value indicated to a
+ * knowledgeable parser how to find the relevant document type definition (DTD).
+ *
+ *
+ * │ │ ╰─── public identifier ─────╯
+ * ╰──┴── name is "html".
+ *
+ * @see https://html.spec.whatwg.org/#tokenization
+ *
+ * @since 6.7.0
+ *
+ * @var string|null
+ */
+ public $public_identifier = \null;
+ /**
+ * System identifier of the DOCTYPE.
+ *
+ * This value should be considered "read only" and not modified.
+ *
+ * The system identifier is optional and should not appear in HTML documents.
+ * A `null` value indicates that no system identifier was present in the DOCTYPE.
+ *
+ * Historically the system identifier specified where a relevant document type
+ * declaration for the given document is stored and may be retrieved.
+ *
+ *
+ * │ │ ╰──── system identifier ────╯
+ * ╰──┴── name is "html".
+ *
+ * If a public identifier were provided it would indicate to a knowledgeable
+ * parser how to interpret the system identifier.
+ *
+ *
+ * │ │ ╰─── public identifier ─────╯ ╰──── system identifier ────╯
+ * ╰──┴── name is "html".
+ *
+ * @see https://html.spec.whatwg.org/#tokenization
+ *
+ * @since 6.7.0
+ *
+ * @var string|null
+ */
+ public $system_identifier = \null;
+ /**
+ * Which document compatability mode this DOCTYPE declaration indicates.
+ *
+ * This value should be considered "read only" and not modified.
+ *
+ * When an HTML parser has not already set the document compatability mode,
+ * (e.g. "quirks" or "no-quirks" mode), it will infer if from the properties
+ * of the appropriate DOCTYPE declaration, if one exists. The DOCTYPE can
+ * indicate one of three possible document compatability modes:
+ *
+ * - "no-quirks" and "limited-quirks" modes (also called "standards" mode).
+ * - "quirks" mode (also called `CSS1Compat` mode).
+ *
+ * An appropriate DOCTYPE is one encountered in the "initial" insertion mode,
+ * before the HTML element has been opened and before finding any other
+ * DOCTYPE declaration tokens.
+ *
+ * @see https://html.spec.whatwg.org/#the-initial-insertion-mode
+ *
+ * @since 6.7.0
+ *
+ * @var string One of "no-quirks", "limited-quirks", or "quirks".
+ */
+ public $indicated_compatability_mode;
+ /**
+ * Creates a WP_HTML_Doctype_Info instance by parsing a raw DOCTYPE declaration token.
+ *
+ * Use this method to parse a DOCTYPE declaration token and get access to its properties
+ * via the returned WP_HTML_Doctype_Info class instance. The provided input must parse
+ * properly as a DOCTYPE declaration, though it must not represent a valid DOCTYPE.
+ *
+ * Example:
+ *
+ * // Normative HTML DOCTYPE declaration.
+ * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '' );
+ * 'no-quirks' === $doctype->indicated_compatability_mode;
+ *
+ * // A nonsensical DOCTYPE is still valid, and will indicate "quirks" mode.
+ * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '' );
+ * 'quirks' === $doctype->indicated_compatability_mode;
+ *
+ * // Textual quirks present in raw HTML are handled appropriately.
+ * $doctype = WP_HTML_Doctype_Info::from_doctype_token( "" );
+ * 'no-quirks' === $doctype->indicated_compatability_mode;
+ *
+ * // Anything other than a proper DOCTYPE declaration token fails to parse.
+ * null === WP_HTML_Doctype_Info::from_doctype_token( ' ' );
+ * null === WP_HTML_Doctype_Info::from_doctype_token( '' );
+ * null === WP_HTML_Doctype_Info::from_doctype_token( '' );
+ * null === WP_HTML_Doctype_Info::from_doctype_token( 'html' );
+ * null === WP_HTML_Doctype_Info::from_doctype_token( '' );
+ *
+ * @since 6.7.0
+ *
+ * @param string $doctype_html The complete raw DOCTYPE HTML string, e.g. ``.
+ *
+ * @return WP_HTML_Doctype_Info|null A WP_HTML_Doctype_Info instance will be returned if the
+ * provided DOCTYPE HTML is a valid DOCTYPE. Otherwise, null.
+ */
+ public static function from_doctype_token(string $doctype_html) : ?self
{
}
}
@@ -61729,7 +63318,7 @@ class WP_HTML_Open_Elements
*
* @param Closure $handler The handler function.
*/
- public function set_pop_handler(\Closure $handler)
+ public function set_pop_handler(\Closure $handler) : void
{
}
/**
@@ -61742,7 +63331,36 @@ public function set_pop_handler(\Closure $handler)
*
* @param Closure $handler The handler function.
*/
- public function set_push_handler(\Closure $handler)
+ public function set_push_handler(\Closure $handler) : void
+ {
+ }
+ /**
+ * Returns the name of the node at the nth position on the stack
+ * of open elements, or `null` if no such position exists.
+ *
+ * Note that this uses a 1-based index, which represents the
+ * "nth item" on the stack, counting from the top, where the
+ * top-most element is the 1st, the second is the 2nd, etc...
+ *
+ * @since 6.7.0
+ *
+ * @param int $nth Retrieve the nth item on the stack, with 1 being
+ * the top element, 2 being the second, etc...
+ * @return WP_HTML_Token|null Name of the node on the stack at the given location,
+ * or `null` if the location isn't on the stack.
+ */
+ public function at(int $nth) : ?\WP_HTML_Token
+ {
+ }
+ /**
+ * Reports if a node of a given name is in the stack of open elements.
+ *
+ * @since 6.7.0
+ *
+ * @param string $node_name Name of node for which to check.
+ * @return bool Whether a node of the given name is in the stack of open elements.
+ */
+ public function contains(string $node_name) : bool
{
}
/**
@@ -61753,7 +63371,7 @@ public function set_push_handler(\Closure $handler)
* @param WP_HTML_Token $token Look for this node in the stack.
* @return bool Whether the referenced node is in the stack of open elements.
*/
- public function contains_node($token)
+ public function contains_node(\WP_HTML_Token $token) : bool
{
}
/**
@@ -61763,7 +63381,7 @@ public function contains_node($token)
*
* @return int How many node are in the stack of open elements.
*/
- public function count()
+ public function count() : int
{
}
/**
@@ -61774,16 +63392,41 @@ public function count()
*
* @return WP_HTML_Token|null Last node in the stack of open elements, if one exists, otherwise null.
*/
- public function current_node()
+ public function current_node() : ?\WP_HTML_Token
{
}
/**
- * Returns whether an element is in a specific scope.
+ * Indicates if the current node is of a given type or name.
*
- * ## HTML Support
+ * It's possible to pass either a node type or a node name to this function.
+ * In the case there is no current element it will always return `false`.
+ *
+ * Example:
*
- * This function skips checking for the termination list because there
- * are no supported elements which appear in the termination list.
+ * // Is the current node a text node?
+ * $stack->current_node_is( '#text' );
+ *
+ * // Is the current node a DIV element?
+ * $stack->current_node_is( 'DIV' );
+ *
+ * // Is the current node any element/tag?
+ * $stack->current_node_is( '#tag' );
+ *
+ * @see WP_HTML_Tag_Processor::get_token_type
+ * @see WP_HTML_Tag_Processor::get_token_name
+ *
+ * @since 6.7.0
+ *
+ * @access private
+ *
+ * @param string $identity Check if the current node has this name or type (depending on what is provided).
+ * @return bool Whether there is a current element that matches the given identity, whether a token name or type.
+ */
+ public function current_node_is(string $identity) : bool
+ {
+ }
+ /**
+ * Returns whether an element is in a specific scope.
*
* @since 6.4.0
*
@@ -61793,77 +63436,133 @@ public function current_node()
* @param string[] $termination_list List of elements that terminate the search.
* @return bool Whether the element was found in a specific scope.
*/
- public function has_element_in_specific_scope($tag_name, $termination_list)
+ public function has_element_in_specific_scope(string $tag_name, $termination_list) : bool
{
}
/**
* Returns whether a particular element is in scope.
*
+ * > The stack of open elements is said to have a particular element in
+ * > scope when it has that element in the specific scope consisting of
+ * > the following element types:
+ * >
+ * > - applet
+ * > - caption
+ * > - html
+ * > - table
+ * > - td
+ * > - th
+ * > - marquee
+ * > - object
+ * > - template
+ * > - MathML mi
+ * > - MathML mo
+ * > - MathML mn
+ * > - MathML ms
+ * > - MathML mtext
+ * > - MathML annotation-xml
+ * > - SVG foreignObject
+ * > - SVG desc
+ * > - SVG title
+ *
* @since 6.4.0
+ * @since 6.7.0 Full support.
*
* @see https://html.spec.whatwg.org/#has-an-element-in-scope
*
* @param string $tag_name Name of tag to check.
* @return bool Whether given element is in scope.
*/
- public function has_element_in_scope($tag_name)
+ public function has_element_in_scope(string $tag_name) : bool
{
}
/**
* Returns whether a particular element is in list item scope.
*
+ * > The stack of open elements is said to have a particular element
+ * > in list item scope when it has that element in the specific scope
+ * > consisting of the following element types:
+ * >
+ * > - All the element types listed above for the has an element in scope algorithm.
+ * > - ol in the HTML namespace
+ * > - ul in the HTML namespace
+ *
* @since 6.4.0
* @since 6.5.0 Implemented: no longer throws on every invocation.
+ * @since 6.7.0 Supports all required HTML elements.
*
* @see https://html.spec.whatwg.org/#has-an-element-in-list-item-scope
*
* @param string $tag_name Name of tag to check.
* @return bool Whether given element is in scope.
*/
- public function has_element_in_list_item_scope($tag_name)
+ public function has_element_in_list_item_scope(string $tag_name) : bool
{
}
/**
* Returns whether a particular element is in button scope.
*
+ * > The stack of open elements is said to have a particular element
+ * > in button scope when it has that element in the specific scope
+ * > consisting of the following element types:
+ * >
+ * > - All the element types listed above for the has an element in scope algorithm.
+ * > - button in the HTML namespace
+ *
* @since 6.4.0
+ * @since 6.7.0 Supports all required HTML elements.
*
* @see https://html.spec.whatwg.org/#has-an-element-in-button-scope
*
* @param string $tag_name Name of tag to check.
* @return bool Whether given element is in scope.
*/
- public function has_element_in_button_scope($tag_name)
+ public function has_element_in_button_scope(string $tag_name) : bool
{
}
/**
* Returns whether a particular element is in table scope.
*
+ * > The stack of open elements is said to have a particular element
+ * > in table scope when it has that element in the specific scope
+ * > consisting of the following element types:
+ * >
+ * > - html in the HTML namespace
+ * > - table in the HTML namespace
+ * > - template in the HTML namespace
+ *
* @since 6.4.0
+ * @since 6.7.0 Full implementation.
*
* @see https://html.spec.whatwg.org/#has-an-element-in-table-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.
*/
- public function has_element_in_table_scope($tag_name)
+ public function has_element_in_table_scope(string $tag_name) : bool
{
}
/**
* Returns whether a particular element is in select scope.
*
- * @since 6.4.0
+ * This test differs from the others like it, in that its rules are inverted.
+ * Instead of arriving at a match when one of any tag in a termination group
+ * is reached, this one terminates if any other tag is reached.
*
- * @see https://html.spec.whatwg.org/#has-an-element-in-select-scope
+ * > The stack of open elements is said to have a particular element in select scope when it has
+ * > that element in the specific scope consisting of all element types except the following:
+ * > - optgroup in the HTML namespace
+ * > - option in the HTML namespace
*
- * @throws WP_HTML_Unsupported_Exception Always until this function is implemented.
+ * @since 6.4.0 Stub implementation (throws).
+ * @since 6.7.0 Full implementation.
+ *
+ * @see https://html.spec.whatwg.org/#has-an-element-in-select-scope
*
* @param string $tag_name Name of tag to check.
- * @return bool Whether given element is in scope.
+ * @return bool Whether the given element is in SELECT scope.
*/
- public function has_element_in_select_scope($tag_name)
+ public function has_element_in_select_scope(string $tag_name) : bool
{
}
/**
@@ -61875,7 +63574,7 @@ public function has_element_in_select_scope($tag_name)
*
* @return bool Whether a P is in BUTTON scope.
*/
- public function has_p_in_button_scope()
+ public function has_p_in_button_scope() : bool
{
}
/**
@@ -61887,20 +63586,20 @@ public function has_p_in_button_scope()
*
* @return bool Whether a node was popped off of the stack.
*/
- public function pop()
+ public function pop() : bool
{
}
/**
- * Pops nodes off of the stack of open elements until one with the given tag name has been popped.
+ * Pops nodes off of the stack of open elements until an HTML tag with the given name has been popped.
*
* @since 6.4.0
*
* @see WP_HTML_Open_Elements::pop
*
- * @param string $tag_name Name of tag that needs to be popped off of the stack of open elements.
+ * @param string $html_tag_name Name of tag that needs to be popped off of the stack of open elements.
* @return bool Whether a tag of the given name was found and popped off of the stack of open elements.
*/
- public function pop_until($tag_name)
+ public function pop_until(string $html_tag_name) : bool
{
}
/**
@@ -61912,7 +63611,7 @@ public function pop_until($tag_name)
*
* @param WP_HTML_Token $stack_item Item to add onto stack.
*/
- public function push($stack_item)
+ public function push(\WP_HTML_Token $stack_item) : void
{
}
/**
@@ -61923,7 +63622,7 @@ public function push($stack_item)
* @param WP_HTML_Token $token The node to remove from the stack of open elements.
* @return bool Whether the node was found and removed from the stack of open elements.
*/
- public function remove_node($token)
+ public function remove_node(\WP_HTML_Token $token) : bool
{
}
/**
@@ -61968,9 +63667,10 @@ public function 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.
+ * @param WP_HTML_Token|null $above_this_node Optional. Start traversing above this node,
+ * if provided and if the node exists.
*/
- public function walk_up($above_this_node = \null)
+ public function walk_up(?\WP_HTML_Token $above_this_node = \null)
{
}
/**
@@ -61986,7 +63686,7 @@ public function walk_up($above_this_node = \null)
*
* @param WP_HTML_Token $item Element that was added to the stack of open elements.
*/
- public function after_element_push($item)
+ public function after_element_push(\WP_HTML_Token $item) : void
{
}
/**
@@ -62002,7 +63702,49 @@ public function after_element_push($item)
*
* @param WP_HTML_Token $item Element that was removed from the stack of open elements.
*/
- public function after_element_pop($item)
+ public function after_element_pop(\WP_HTML_Token $item) : void
+ {
+ }
+ /**
+ * Clear the stack back to a table context.
+ *
+ * > When the steps above require the UA to clear the stack back to a table context, it means
+ * > that the UA must, while the current node is not a table, template, or html element, pop
+ * > elements from the stack of open elements.
+ *
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-context
+ *
+ * @since 6.7.0
+ */
+ public function clear_to_table_context() : void
+ {
+ }
+ /**
+ * Clear the stack back to a table body context.
+ *
+ * > When the steps above require the UA to clear the stack back to a table body context, it
+ * > means that the UA must, while the current node is not a tbody, tfoot, thead, template, or
+ * > html element, pop elements from the stack of open elements.
+ *
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-body-context
+ *
+ * @since 6.7.0
+ */
+ public function clear_to_table_body_context() : void
+ {
+ }
+ /**
+ * Clear the stack back to a table row context.
+ *
+ * > When the steps above require the UA to clear the stack back to a table row context, it
+ * > means that the UA must, while the current node is not a tr, template, or html element, pop
+ * > elements from the stack of open elements.
+ *
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-row-context
+ *
+ * @since 6.7.0
+ */
+ public function clear_to_table_row_context() : void
{
}
/**
@@ -62053,6 +63795,61 @@ class WP_HTML_Processor_State
* @var string
*/
const INSERTION_MODE_INITIAL = 'insertion-mode-initial';
+ /**
+ * Before HTML insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_BEFORE_HTML = 'insertion-mode-before-html';
+ /**
+ * Before head insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-beforehead
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head';
+ /**
+ * In head insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inhead
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head';
+ /**
+ * In head noscript insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_HEAD_NOSCRIPT = 'insertion-mode-in-head-noscript';
+ /**
+ * After head insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-afterhead
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head';
/**
* In body insertion mode for full HTML parser.
*
@@ -62064,6 +63861,181 @@ class WP_HTML_Processor_State
* @var string
*/
const INSERTION_MODE_IN_BODY = 'insertion-mode-in-body';
+ /**
+ * In table insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-intable
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table';
+ /**
+ * In table text insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-intabletext
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_TABLE_TEXT = 'insertion-mode-in-table-text';
+ /**
+ * In caption insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-incaption
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption';
+ /**
+ * In column group insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group';
+ /**
+ * In table body insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-intablebody
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body';
+ /**
+ * In row insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inrow
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row';
+ /**
+ * In cell insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-incell
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell';
+ /**
+ * In select insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inselect
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_SELECT = 'insertion-mode-in-select';
+ /**
+ * In select in table insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inselectintable
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_SELECT_IN_TABLE = 'insertion-mode-in-select-in-table';
+ /**
+ * In template insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-intemplate
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template';
+ /**
+ * After body insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-afterbody
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_AFTER_BODY = 'insertion-mode-after-body';
+ /**
+ * In frameset insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-inframeset
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_IN_FRAMESET = 'insertion-mode-in-frameset';
+ /**
+ * After frameset insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#parsing-main-afterframeset
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_AFTER_FRAMESET = 'insertion-mode-after-frameset';
+ /**
+ * After after body insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_AFTER_AFTER_BODY = 'insertion-mode-after-after-body';
+ /**
+ * After after frameset insertion mode for full HTML parser.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode
+ * @see WP_HTML_Processor_State::$insertion_mode
+ *
+ * @var string
+ */
+ const INSERTION_MODE_AFTER_AFTER_FRAMESET = 'insertion-mode-after-after-frameset';
+ /**
+ * The stack of template insertion modes.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/#the-insertion-mode:stack-of-template-insertion-modes
+ *
+ * @var array
+ */
+ public $stack_of_template_insertion_modes = array();
/**
* Tracks open elements while scanning HTML.
*
@@ -62075,7 +64047,7 @@ class WP_HTML_Processor_State
*
* @var WP_HTML_Open_Elements
*/
- public $stack_of_open_elements = \null;
+ public $stack_of_open_elements;
/**
* Tracks open formatting elements, used to handle mis-nested formatting element tags.
*
@@ -62087,7 +64059,7 @@ class WP_HTML_Processor_State
*
* @var WP_HTML_Active_Formatting_Elements
*/
- public $active_formatting_elements = \null;
+ public $active_formatting_elements;
/**
* Refers to the currently-matched tag, if any.
*
@@ -62116,6 +64088,63 @@ class WP_HTML_Processor_State
* @var [string, array]|null
*/
public $context_node = \null;
+ /**
+ * The recognized encoding of the input byte stream.
+ *
+ * > The stream of code points that comprises the input to the tokenization
+ * > stage will be initially seen by the user agent as a stream of bytes
+ * > (typically coming over the network or from the local file system).
+ * > The bytes encode the actual characters according to a particular character
+ * > encoding, which the user agent uses to decode the bytes into characters.
+ *
+ * @since 6.7.0
+ *
+ * @var string|null
+ */
+ public $encoding = \null;
+ /**
+ * The parser's confidence in the input encoding.
+ *
+ * > When the HTML parser is decoding an input byte stream, it uses a character
+ * > encoding and a confidence. The confidence is either tentative, certain, or
+ * > irrelevant. The encoding used, and whether the confidence in that encoding
+ * > is tentative or certain, is used during the parsing to determine whether to
+ * > change the encoding. If no encoding is necessary, e.g. because the parser is
+ * > operating on a Unicode stream and doesn't have to use a character encoding
+ * > at all, then the confidence is irrelevant.
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ public $encoding_confidence = 'tentative';
+ /**
+ * HEAD element pointer.
+ *
+ * @since 6.7.0
+ *
+ * @see https://html.spec.whatwg.org/multipage/parsing.html#head-element-pointer
+ *
+ * @var WP_HTML_Token|null
+ */
+ public $head_element = \null;
+ /**
+ * FORM element pointer.
+ *
+ * > points to the last form element that was opened and whose end tag has
+ * > not yet been seen. It is used to make form controls associate with
+ * > forms in the face of dramatically bad markup, for historical reasons.
+ * > It is ignored inside template elements.
+ *
+ * @todo This may be invalidated by a seek operation.
+ *
+ * @see https://html.spec.whatwg.org/#form-element-pointer
+ *
+ * @since 6.7.0
+ *
+ * @var WP_HTML_Token|null
+ */
+ public $form_element = \null;
/**
* The frameset-ok flag indicates if a `FRAMESET` element is allowed in the current state.
*
@@ -62247,7 +64276,7 @@ public function __construct()
* $processor = new WP_HTML_Tag_Processor( '' );
* true === $processor->next_tag( 'DIV' );
*
- * #### Special elements
+ * #### Special self-contained elements
*
* Some HTML elements are handled in a special way; their start and end tags
* act like a void tag. These are special because their contents can't contain
@@ -62586,6 +64615,31 @@ class WP_HTML_Tag_Processor
* @var string
*/
protected $parser_state = self::STATE_READY;
+ /**
+ * Indicates if the document is in quirks mode or no-quirks mode.
+ *
+ * Impact on HTML parsing:
+ *
+ * - In `NO_QUIRKS_MODE` (also known as "standard mode"):
+ * - CSS class and ID selectors match byte-for-byte (case-sensitively).
+ * - A TABLE start tag `
` implicitly closes any open `P` element.
+ *
+ * - In `QUIRKS_MODE`:
+ * - CSS class and ID selectors match match in an ASCII case-insensitive manner.
+ * - A TABLE start tag `` opens a `TABLE` element as a child of a `P`
+ * element if one is open.
+ *
+ * Quirks and no-quirks mode are thus mostly about styling, but have an impact when
+ * tables are found inside paragraph elements.
+ *
+ * @see self::QUIRKS_MODE
+ * @see self::NO_QUIRKS_MODE
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ protected $compat_mode = self::NO_QUIRKS_MODE;
/**
* What kind of syntax token became an HTML comment.
*
@@ -62598,6 +64652,19 @@ class WP_HTML_Tag_Processor
* @var string|null
*/
protected $comment_type = \null;
+ /**
+ * What kind of text the matched text node represents, if it was subdivided.
+ *
+ * @see self::TEXT_IS_NULL_SEQUENCE
+ * @see self::TEXT_IS_WHITESPACE
+ * @see self::TEXT_IS_GENERIC
+ * @see self::subdivide_text_appropriately
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ protected $text_node_classification = self::TEXT_IS_GENERIC;
/**
* Tracks a semantic location in the original HTML which
* shifts with updates as they are applied to the document.
@@ -62671,6 +64738,20 @@ class WP_HTML_Tag_Processor
public function __construct($html)
{
}
+ /**
+ * Switches parsing mode into a new namespace, such as when
+ * encountering an SVG tag and entering foreign content.
+ *
+ * @since 6.7.0
+ *
+ * @param string $new_namespace One of 'html', 'svg', or 'math' indicating into what
+ * namespace the next tokens will be processed.
+ * @return bool Whether the namespace was valid and changed.
+ * @phpstan-param 'html'|'svg'|'math' $new_namespace
+ */
+ public function change_parsing_namespace(string $new_namespace) : bool
+ {
+ }
/**
* Finds the next tag matching the $query.
*
@@ -62695,7 +64776,7 @@ public function __construct($html)
* tag_closers?: string|null,
* } $query
*/
- public function next_tag($query = \null)
+ public function next_tag($query = \null) : bool
{
}
/**
@@ -62722,10 +64803,11 @@ public function next_tag($query = \null)
* The Tag Processor currently only supports the tag token.
*
* @since 6.5.0
+ * @since 6.7.0 Recognizes CDATA sections within foreign content.
*
* @return bool Whether a token was parsed.
*/
- public function next_token()
+ public function next_token() : bool
{
}
/**
@@ -62742,7 +64824,7 @@ public function next_token()
*
* @return bool Whether the parse paused at the start of an incomplete token.
*/
- public function paused_at_incomplete_token()
+ public function paused_at_incomplete_token() : bool
{
}
/**
@@ -62773,7 +64855,7 @@ public function class_list()
* @param string $wanted_class Look for this CSS class name, ASCII case-insensitive.
* @return bool|null Whether the matched tag contains the given class name, or null if not matched.
*/
- public function has_class($wanted_class)
+ public function has_class($wanted_class) : ?bool
{
}
/**
@@ -62856,7 +64938,7 @@ public function has_class($wanted_class)
* @param string $name Identifies this particular bookmark.
* @return bool Whether the bookmark was successfully created.
*/
- public function set_bookmark($name)
+ public function set_bookmark($name) : bool
{
}
/**
@@ -62868,7 +64950,7 @@ public function set_bookmark($name)
* @param string $name Name of the bookmark to remove.
* @return bool Whether the bookmark already existed before removal.
*/
- public function release_bookmark($name)
+ public function release_bookmark($name) : bool
{
}
/**
@@ -62879,7 +64961,7 @@ public function release_bookmark($name)
* @param string $bookmark_name Name to identify a bookmark that potentially exists.
* @return bool Whether that bookmark exists.
*/
- public function has_bookmark($bookmark_name)
+ public function has_bookmark($bookmark_name) : bool
{
}
/**
@@ -62893,7 +64975,7 @@ public function has_bookmark($bookmark_name)
* @param string $bookmark_name Jump to the place in the document identified by this bookmark name.
* @return bool Whether the internal cursor was successfully moved to the bookmark's location.
*/
- public function seek($bookmark_name)
+ public function seek($bookmark_name) : bool
{
}
/**
@@ -62944,7 +65026,18 @@ public function get_attribute($name)
* @param string $prefix Prefix of requested attribute names.
* @return array|null List of attribute names, or `null` when no tag opener is matched.
*/
- public function get_attribute_names_with_prefix($prefix)
+ public function get_attribute_names_with_prefix($prefix) : ?array
+ {
+ }
+ /**
+ * Returns the namespace of the matched token.
+ *
+ * @since 6.7.0
+ *
+ * @return string One of 'html', 'math', or 'svg'.
+ * @phpstan-return 'html'|'math'|'svg'
+ */
+ public function get_namespace() : string
{
}
/**
@@ -62963,7 +65056,31 @@ public function get_attribute_names_with_prefix($prefix)
*
* @return string|null Name of currently matched tag in input HTML, or `null` if none found.
*/
- public function get_tag()
+ public function get_tag() : ?string
+ {
+ }
+ /**
+ * Returns the adjusted tag name for a given token, taking into
+ * account the current parsing context, whether HTML, SVG, or MathML.
+ *
+ * @since 6.7.0
+ *
+ * @return string|null Name of current tag name.
+ */
+ public function get_qualified_tag_name() : ?string
+ {
+ }
+ /**
+ * Returns the adjusted attribute name for a given attribute, taking into
+ * account the current parsing context, whether HTML, SVG, or MathML.
+ *
+ * @since 6.7.0
+ *
+ * @param string $attribute_name Which attribute to adjust.
+ *
+ * @return string|null
+ */
+ public function get_qualified_attribute_name($attribute_name) : ?string
{
}
/**
@@ -62983,7 +65100,7 @@ public function get_tag()
*
* @return bool Whether the currently matched tag contains the self-closing flag.
*/
- public function has_self_closing_flag()
+ public function has_self_closing_flag() : bool
{
}
/**
@@ -62999,10 +65116,11 @@ public function has_self_closing_flag()
* $p->is_tag_closer() === true;
*
* @since 6.2.0
+ * @since 6.7.0 Reports all BR tags as opening tags.
*
* @return bool Whether the current tag is a tag closer.
*/
- public function is_tag_closer()
+ public function is_tag_closer() : bool
{
}
/**
@@ -63027,7 +65145,7 @@ public function is_tag_closer()
*
* @return string|null What kind of token is matched, or null.
*/
- public function get_token_type()
+ public function get_token_type() : ?string
{
}
/**
@@ -63050,7 +65168,7 @@ public function get_token_type()
*
* @return string|null Name of the matched token.
*/
- public function get_token_name()
+ public function get_token_name() : ?string
{
}
/**
@@ -63072,7 +65190,62 @@ public function get_token_name()
*
* @return string|null
*/
- public function get_comment_type()
+ public function get_comment_type() : ?string
+ {
+ }
+ /**
+ * Returns the text of a matched comment or null if not on a comment type node.
+ *
+ * This method returns the entire text content of a comment node as it
+ * would appear in the browser.
+ *
+ * This differs from {@see ::get_modifiable_text()} in that certain comment
+ * types in the HTML API cannot allow their entire comment text content to
+ * be modified. Namely, "bogus comments" of the form ``
+ * will create a comment whose text content starts with `?`. Note that if
+ * that character were modified, it would be possible to change the node
+ * type.
+ *
+ * @since 6.7.0
+ *
+ * @return string|null The comment text as it would appear in the browser or null
+ * if not on a comment type node.
+ */
+ public function get_full_comment_text() : ?string
+ {
+ }
+ /**
+ * Subdivides a matched text node, splitting NULL byte sequences and decoded whitespace as
+ * distinct nodes prefixes.
+ *
+ * Note that once anything that's neither a NULL byte nor decoded whitespace is
+ * encountered, then the remainder of the text node is left intact as generic text.
+ *
+ * - The HTML Processor uses this to apply distinct rules for different kinds of text.
+ * - Inter-element whitespace can be detected and skipped with this method.
+ *
+ * Text nodes aren't eagerly subdivided because there's no need to split them unless
+ * decisions are being made on NULL byte sequences or whitespace-only text.
+ *
+ * Example:
+ *
+ * $processor = new WP_HTML_Tag_Processor( "\x00Apples & Oranges" );
+ * true === $processor->next_token(); // Text is "Apples & Oranges".
+ * true === $processor->subdivide_text_appropriately(); // Text is "".
+ * true === $processor->next_token(); // Text is "Apples & Oranges".
+ * false === $processor->subdivide_text_appropriately();
+ *
+ * $processor = new WP_HTML_Tag_Processor( " \r\n\tMore" );
+ * true === $processor->next_token(); // Text is " ␉More".
+ * true === $processor->subdivide_text_appropriately(); // Text is " ␉".
+ * true === $processor->next_token(); // Text is "More".
+ * false === $processor->subdivide_text_appropriately();
+ *
+ * @since 6.7.0
+ *
+ * @return bool Whether the text node was subdivided.
+ */
+ public function subdivide_text_appropriately() : bool
{
}
/**
@@ -63091,11 +65264,68 @@ public function get_comment_type()
* that a token has modifiable text, and a token with modifiable text may
* have an empty string (e.g. a comment with no contents).
*
+ * Limitations:
+ *
+ * - This function will not strip the leading newline appropriately
+ * after seeking into a LISTING or PRE element. To ensure that the
+ * newline is treated properly, seek to the LISTING or PRE opening
+ * tag instead of to the first text node inside the element.
+ *
* @since 6.5.0
+ * @since 6.7.0 Replaces NULL bytes (U+0000) and newlines appropriately.
*
* @return string
*/
- public function get_modifiable_text()
+ public function get_modifiable_text() : string
+ {
+ }
+ /**
+ * Sets the modifiable text for the matched token, if matched.
+ *
+ * Modifiable text is text content that may be read and changed without
+ * changing the HTML structure of the document around it. This includes
+ * the contents of `#text` nodes in the HTML as well as the inner
+ * contents of HTML comments, Processing Instructions, and others, even
+ * though these nodes aren't part of a parsed DOM tree. They also contain
+ * the contents of SCRIPT and STYLE tags, of TEXTAREA tags, and of any
+ * other section in an HTML document which cannot contain HTML markup (DATA).
+ *
+ * Not all modifiable text may be set by this method, and not all content
+ * may be set as modifiable text. In the case that this fails it will return
+ * `false` indicating as much. For instance, it will not allow inserting the
+ * string `next_tag( 'STYLE' ) ) {
+ * $style = $processor->get_modifiable_text();
+ * $processor->set_modifiable_text( "// Made with love on the World Wide Web\n{$style}" );
+ * }
+ *
+ * // Replace smiley text with Emoji smilies.
+ * while ( $processor->next_token() ) {
+ * if ( '#text' !== $processor->get_token_name() ) {
+ * continue;
+ * }
+ *
+ * $chunk = $processor->get_modifiable_text();
+ * if ( ! str_contains( $chunk, ':)' ) ) {
+ * continue;
+ * }
+ *
+ * $processor->set_modifiable_text( str_replace( ':)', '🙂', $chunk ) );
+ * }
+ *
+ * @since 6.7.0
+ *
+ * @param string $plaintext_content New text content to represent in the matched token.
+ *
+ * @return bool Whether the text was able to update.
+ */
+ public function set_modifiable_text(string $plaintext_content) : bool
{
}
/**
@@ -63114,7 +65344,7 @@ public function get_modifiable_text()
* @param string|bool $value The new attribute value.
* @return bool Whether an attribute value was set.
*/
- public function set_attribute($name, $value)
+ public function set_attribute($name, $value) : bool
{
}
/**
@@ -63125,7 +65355,7 @@ public function set_attribute($name, $value)
* @param string $name The attribute name to remove.
* @return bool Whether an attribute was removed.
*/
- public function remove_attribute($name)
+ public function remove_attribute($name) : bool
{
}
/**
@@ -63136,7 +65366,7 @@ public function remove_attribute($name)
* @param string $class_name The class name to add.
* @return bool Whether the class was set to be added.
*/
- public function add_class($class_name)
+ public function add_class($class_name) : bool
{
}
/**
@@ -63147,7 +65377,7 @@ public function add_class($class_name)
* @param string $class_name The class name to remove.
* @return bool Whether the class was set to be removed.
*/
- public function remove_class($class_name)
+ public function remove_class($class_name) : bool
{
}
/**
@@ -63159,7 +65389,7 @@ public function remove_class($class_name)
*
* @return string The processed HTML.
*/
- public function __toString()
+ public function __toString() : string
{
}
/**
@@ -63171,7 +65401,23 @@ public function __toString()
*
* @return string The processed HTML.
*/
- public function get_updated_html()
+ public function get_updated_html() : string
+ {
+ }
+ /**
+ * Gets DOCTYPE declaration info from a DOCTYPE token.
+ *
+ * DOCTYPE tokens may appear in many places in an HTML document. In most places, they are
+ * simply ignored. The main parsing functions find the basic shape of DOCTYPE tokens but
+ * do not perform detailed parsing.
+ *
+ * This method can be called to perform a full parse of the DOCTYPE token and retrieve
+ * its information.
+ *
+ * @return WP_HTML_Doctype_Info|null The DOCTYPE declaration information or `null` if not
+ * currently at a DOCTYPE node.
+ */
+ public function get_doctype_info() : ?\WP_HTML_Doctype_Info
{
}
/**
@@ -63258,7 +65504,7 @@ public function get_updated_html()
const STATE_COMMENT = 'STATE_COMMENT';
/**
* Indicates that the parser has found a DOCTYPE node and it's
- * possible to read and modify its modifiable text.
+ * possible to read its DOCTYPE information via `get_doctype_info()`.
*
* @since 6.5.0
*
@@ -63361,6 +65607,63 @@ public function get_updated_html()
* @since 6.5.0
*/
const COMMENT_AS_INVALID_HTML = 'COMMENT_AS_INVALID_HTML';
+ /**
+ * No-quirks mode document compatability mode.
+ *
+ * > In no-quirks mode, the behavior is (hopefully) the desired behavior
+ * > described by the modern HTML and CSS specifications.
+ *
+ * @see self::$compat_mode
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ const NO_QUIRKS_MODE = 'no-quirks-mode';
+ /**
+ * Quirks mode document compatability mode.
+ *
+ * > In quirks mode, layout emulates behavior in Navigator 4 and Internet
+ * > Explorer 5. This is essential in order to support websites that were
+ * > built before the widespread adoption of web standards.
+ *
+ * @see self::$compat_mode
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ const QUIRKS_MODE = 'quirks-mode';
+ /**
+ * Indicates that a span of text may contain any combination of significant
+ * kinds of characters: NULL bytes, whitespace, and others.
+ *
+ * @see self::$text_node_classification
+ * @see self::subdivide_text_appropriately
+ *
+ * @since 6.7.0
+ */
+ const TEXT_IS_GENERIC = 'TEXT_IS_GENERIC';
+ /**
+ * Indicates that a span of text comprises a sequence only of NULL bytes.
+ *
+ * @see self::$text_node_classification
+ * @see self::subdivide_text_appropriately
+ *
+ * @since 6.7.0
+ */
+ const TEXT_IS_NULL_SEQUENCE = 'TEXT_IS_NULL_SEQUENCE';
+ /**
+ * Indicates that a span of decoded text comprises only whitespace.
+ *
+ * @see self::$text_node_classification
+ * @see self::subdivide_text_appropriately
+ *
+ * @since 6.7.0
+ */
+ const TEXT_IS_WHITESPACE = 'TEXT_IS_WHITESPACE';
}
/**
* Core class used to safely parse and modify an HTML document.
@@ -63452,22 +65755,11 @@ public function get_updated_html()
* will abort early and stop all processing. This draconian measure ensures
* that the HTML Processor won't break any HTML it doesn't fully understand.
*
- * 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.
- * - 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.
+ * The HTML Processor supports all elements other than a specific set:
+ *
+ * - Any element inside a TABLE.
+ * - Any element inside foreign content, including SVG and MATH.
+ * - Any element outside the IN BODY insertion mode, e.g. doctype declarations, meta, links.
*
* ### Supported markup
*
@@ -63476,15 +65768,30 @@ public function get_updated_html()
* may in fact belong _before_ the table in the DOM. If the HTML Processor encounters
* such a case it will stop processing.
*
- * The following list specifies HTML markup that _is_ supported:
+ * The following list illustrates some common examples of unexpected HTML inputs that
+ * the HTML Processor properly parses and represents:
+ *
+ * - HTML with optional tags omitted, e.g. `one
two`.
+ * - HTML with unexpected tag closers, e.g. `
one more
`.
+ * - Non-void tags with self-closing flag, e.g. `the DIV is still open.`.
+ * - Heading elements which close open heading elements of another level, e.g. `Closed by `.
+ * - Elements containing text that looks like other tags but isn't, e.g. `The is plaintext`.
+ * - SCRIPT and STYLE tags containing text that looks like HTML but isn't, e.g. ``.
+ * - SCRIPT content which has been escaped, e.g. `') -->`.
+ *
+ * ### Unsupported Features
+ *
+ * This parser does not report parse errors.
*
- * - Markup involving only those tags listed above.
- * - Fully-balanced and non-overlapping tags.
- * - HTML with unexpected tag closers.
- * - Some unbalanced or overlapping tags.
- * - P tags after unclosed P tags.
- * - BUTTON tags after unclosed BUTTON tags.
- * - A tags after unclosed A tags that don't involve any active formatting elements.
+ * Normally, when additional HTML or BODY tags are encountered in a document, if there
+ * are any additional attributes on them that aren't found on the previous elements,
+ * the existing HTML and BODY elements adopt those missing attribute values. This
+ * parser does not add those additional attributes.
+ *
+ * In certain situations, elements are moved to a different part of the document in
+ * a process called "adoption" and "fostering." Because the nodes move to a location
+ * in the document that the parser had already processed, this parser does not support
+ * these situations and will bail.
*
* @since 6.4.0
*
@@ -63539,6 +65846,25 @@ class WP_HTML_Processor extends \WP_HTML_Tag_Processor
public static function create_fragment($html, $context = '', $encoding = 'UTF-8')
{
}
+ /**
+ * Creates an HTML processor in the full parsing mode.
+ *
+ * It's likely that a fragment parser is more appropriate, unless sending an
+ * entire HTML document from start to finish. Consider a fragment parser with
+ * a context node of ``.
+ *
+ * Since UTF-8 is the only currently-accepted charset, if working with a
+ * document that isn't UTF-8, it's important to convert the document before
+ * creating the processor: pass in the converted HTML.
+ *
+ * @param string $html Input HTML document to process.
+ * @param string|null $known_definite_encoding Optional. If provided, specifies the charset used
+ * in the input byte stream. Currently must be UTF-8.
+ * @return static|null The created processor if successful, otherwise null.
+ */
+ public static function create_full_parser($html, $known_definite_encoding = 'UTF-8')
+ {
+ }
/**
* Constructor.
*
@@ -63579,7 +65905,21 @@ public function __construct($html, $use_the_static_create_methods_instead = \nul
*
* @return string|null The last error, if one exists, otherwise null.
*/
- public function get_last_error()
+ public function get_last_error() : ?string
+ {
+ }
+ /**
+ * Returns context for why the parser aborted due to unsupported HTML, if it did.
+ *
+ * This is meant for debugging purposes, not for production use.
+ *
+ * @since 6.7.0
+ *
+ * @see self::$unsupported_exception
+ *
+ * @return WP_HTML_Unsupported_Exception|null
+ */
+ public function get_unsupported_exception()
{
}
/**
@@ -63613,7 +65953,7 @@ public function get_last_error()
* breadcrumbs?: string[],
* } $query
*/
- public function next_tag($query = \null)
+ public function next_tag($query = \null) : bool
{
}
/**
@@ -63630,7 +65970,7 @@ public function next_tag($query = \null)
*
* @return bool
*/
- public function next_token()
+ public function next_token() : bool
{
}
/**
@@ -63649,7 +65989,7 @@ public function next_token()
*
* @return bool Whether the current tag is a tag closer.
*/
- public function is_tag_closer()
+ public function is_tag_closer() : bool
{
}
/**
@@ -63677,7 +66017,7 @@ public function is_tag_closer()
* May also contain the wildcard `*` which matches a single element, e.g. `array( 'SECTION', '*' )`.
* @return bool Whether the currently-matched tag is found at the given nested structure.
*/
- public function matches_breadcrumbs($breadcrumbs)
+ public function matches_breadcrumbs($breadcrumbs) : bool
{
}
/**
@@ -63693,15 +66033,12 @@ public function matches_breadcrumbs($breadcrumbs)
*
* @since 6.6.0
*
- * @todo When adding support for foreign content, ensure that
- * this returns false for self-closing elements in the
- * SVG and MathML namespace.
- *
- * @param ?WP_HTML_Token $node Node to examine instead of current node, if provided.
- * @return bool Whether to expect a closer for the currently-matched node,
- * or `null` if not matched on any token.
+ * @param WP_HTML_Token|null $node Optional. Node to examine, if provided.
+ * Default is to examine current node.
+ * @return bool|null Whether to expect a closer for the currently-matched node,
+ * or `null` if not matched on any token.
*/
- public function expects_closer($node = \null)
+ public function expects_closer(?\WP_HTML_Token $node = \null) : ?bool
{
}
/**
@@ -63717,7 +66054,7 @@ public function expects_closer($node = \null)
* @param string $node_to_process Whether to parse the next node or reprocess the current node.
* @return bool Whether a tag was matched.
*/
- public function step($node_to_process = self::PROCESS_NEXT_NODE)
+ public function step($node_to_process = self::PROCESS_NEXT_NODE) : bool
{
}
/**
@@ -63740,7 +66077,7 @@ public function step($node_to_process = self::PROCESS_NEXT_NODE)
*
* @return string[]|null Array of tag names representing path to matched node, if matched, otherwise NULL.
*/
- public function get_breadcrumbs()
+ public function get_breadcrumbs() : ?array
{
}
/**
@@ -63768,7 +66105,114 @@ public function get_breadcrumbs()
*
* @return int Nesting-depth of current location in the document.
*/
- public function get_current_depth()
+ public function get_current_depth() : int
+ {
+ }
+ /**
+ * Normalizes an HTML fragment by serializing it.
+ *
+ * This method assumes that the given HTML snippet is found in BODY context.
+ * For normalizing full documents or fragments found in other contexts, create
+ * a new processor using {@see WP_HTML_Processor::create_fragment} or
+ * {@see WP_HTML_Processor::create_full_parser} and call {@see WP_HTML_Processor::serialize}
+ * on the created instances.
+ *
+ * Many aspects of an input HTML fragment may be changed during normalization.
+ *
+ * - Attribute values will be double-quoted.
+ * - Duplicate attributes will be removed.
+ * - Omitted tags will be added.
+ * - Tag and attribute name casing will be lower-cased,
+ * except for specific SVG and MathML tags or attributes.
+ * - Text will be re-encoded, null bytes handled,
+ * and invalid UTF-8 replaced with U+FFFD.
+ * - Any incomplete syntax trailing at the end will be omitted,
+ * for example, an unclosed comment opener will be removed.
+ *
+ * Example:
+ *
+ * echo WP_HTML_Processor::normalize( 'One syntax < <> "oddities"
+ *
+ * @since 6.7.0
+ *
+ * @param string $html Input HTML to normalize.
+ *
+ * @return string|null Normalized output, or `null` if unable to normalize.
+ */
+ public static function normalize(string $html) : ?string
+ {
+ }
+ /**
+ * Returns normalized HTML for a fragment by serializing it.
+ *
+ * This differs from {@see WP_HTML_Processor::normalize} in that it starts with
+ * a specific HTML Processor, which _must_ not have already started scanning;
+ * it must be in the initial ready state and will be in the completed state once
+ * serialization is complete.
+ *
+ * Many aspects of an input HTML fragment may be changed during normalization.
+ *
+ * - Attribute values will be double-quoted.
+ * - Duplicate attributes will be removed.
+ * - Omitted tags will be added.
+ * - Tag and attribute name casing will be lower-cased,
+ * except for specific SVG and MathML tags or attributes.
+ * - Text will be re-encoded, null bytes handled,
+ * and invalid UTF-8 replaced with U+FFFD.
+ * - Any incomplete syntax trailing at the end will be omitted,
+ * for example, an unclosed comment opener will be removed.
+ *
+ * Example:
+ *
+ * $processor = WP_HTML_Processor::create_fragment( 'One syntax < <> "oddities"
+ *
+ * @since 6.7.0
+ *
+ * @return string|null Normalized HTML markup represented by processor,
+ * or `null` if unable to generate serialization.
+ */
+ public function serialize() : ?string
+ {
+ }
+ /**
+ * Serializes the currently-matched token.
+ *
+ * This method produces a fully-normative HTML string for the currently-matched token,
+ * if able. If not matched at any token or if the token doesn't correspond to any HTML
+ * it will return an empty string (for example, presumptuous end tags are ignored).
+ *
+ * @see static::serialize()
+ *
+ * @since 6.7.0
+ *
+ * @return string Serialization of token, or empty string if no serialization exists.
+ */
+ protected function serialize_token() : string
+ {
+ }
+ /**
+ * Indicates the namespace of the current token, or "html" if there is none.
+ *
+ * @return string One of "html", "math", or "svg".
+ */
+ public function get_namespace() : string
{
}
/**
@@ -63792,7 +66236,7 @@ public function get_current_depth()
*
* @return string|null Name of currently matched tag in input HTML, or `null` if none found.
*/
- public function get_tag()
+ public function get_tag() : ?string
{
}
/**
@@ -63812,7 +66256,7 @@ public function get_tag()
*
* @return bool Whether the currently matched tag contains the self-closing flag.
*/
- public function has_self_closing_flag()
+ public function has_self_closing_flag() : bool
{
}
/**
@@ -63835,7 +66279,7 @@ public function has_self_closing_flag()
*
* @return string|null Name of the matched token.
*/
- public function get_token_name()
+ public function get_token_name() : ?string
{
}
/**
@@ -63860,7 +66304,7 @@ public function get_token_name()
*
* @return string|null What kind of token is matched, or null.
*/
- public function get_token_type()
+ public function get_token_type() : ?string
{
}
/**
@@ -63900,7 +66344,7 @@ public function get_attribute($name)
* @param string|bool $value The new attribute value.
* @return bool Whether an attribute value was set.
*/
- public function set_attribute($name, $value)
+ public function set_attribute($name, $value) : bool
{
}
/**
@@ -63911,7 +66355,7 @@ public function set_attribute($name, $value)
* @param string $name The attribute name to remove.
* @return bool Whether an attribute was removed.
*/
- public function remove_attribute($name)
+ public function remove_attribute($name) : bool
{
}
/**
@@ -63940,7 +66384,7 @@ public function remove_attribute($name)
* @param string $prefix Prefix of requested attribute names.
* @return array|null List of attribute names, or `null` when no tag opener is matched.
*/
- public function get_attribute_names_with_prefix($prefix)
+ public function get_attribute_names_with_prefix($prefix) : ?array
{
}
/**
@@ -63951,7 +66395,7 @@ public function get_attribute_names_with_prefix($prefix)
* @param string $class_name The class name to add.
* @return bool Whether the class was set to be added.
*/
- public function add_class($class_name)
+ public function add_class($class_name) : bool
{
}
/**
@@ -63962,7 +66406,7 @@ public function add_class($class_name)
* @param string $class_name The class name to remove.
* @return bool Whether the class was set to be removed.
*/
- public function remove_class($class_name)
+ public function remove_class($class_name) : bool
{
}
/**
@@ -63970,10 +66414,14 @@ public function remove_class($class_name)
*
* @since 6.6.0 Subclassed for the HTML Processor.
*
+ * @todo When reconstructing active formatting elements with attributes, find a way
+ * to indicate if the virtually-reconstructed formatting elements contain the
+ * wanted class name.
+ *
* @param string $wanted_class Look for this CSS class name, ASCII case-insensitive.
* @return bool|null Whether the matched tag contains the given class name, or null if not matched.
*/
- public function has_class($wanted_class)
+ public function has_class($wanted_class) : ?bool
{
}
/**
@@ -64015,7 +66463,7 @@ public function class_list()
*
* @return string
*/
- public function get_modifiable_text()
+ public function get_modifiable_text() : string
{
}
/**
@@ -64037,7 +66485,7 @@ public function get_modifiable_text()
*
* @return string|null
*/
- public function get_comment_type()
+ public function get_comment_type() : ?string
{
}
/**
@@ -64051,7 +66499,7 @@ public function get_comment_type()
* @param string $bookmark_name Name of the bookmark to remove.
* @return bool Whether the bookmark already existed before removal.
*/
- public function release_bookmark($bookmark_name)
+ public function release_bookmark($bookmark_name) : bool
{
}
/**
@@ -64071,7 +66519,7 @@ public function release_bookmark($bookmark_name)
* @param string $bookmark_name Jump to the place in the document identified by this bookmark name.
* @return bool Whether the internal cursor was successfully moved to the bookmark's location.
*/
- public function seek($bookmark_name)
+ public function seek($bookmark_name) : bool
{
}
/**
@@ -64154,7 +66602,7 @@ public function seek($bookmark_name)
* @param string $bookmark_name Identifies this particular bookmark.
* @return bool Whether the bookmark was successfully created.
*/
- public function set_bookmark($bookmark_name)
+ public function set_bookmark($bookmark_name) : bool
{
}
/**
@@ -64165,7 +66613,7 @@ public function set_bookmark($bookmark_name)
* @param string $bookmark_name Name to identify a bookmark that potentially exists.
* @return bool Whether that bookmark exists.
*/
- public function has_bookmark($bookmark_name)
+ public function has_bookmark($bookmark_name) : bool
{
}
/**
@@ -64175,10 +66623,10 @@ public function has_bookmark($bookmark_name)
*
* @see https://html.spec.whatwg.org/#special
*
- * @param string $tag_name Name of element to check.
+ * @param WP_HTML_Token|string $tag_name Node to check, or only its name if in the HTML namespace.
* @return bool Whether the element of the given name is in the special category.
*/
- public static function is_special($tag_name)
+ public static function is_special($tag_name) : bool
{
}
/**
@@ -64193,7 +66641,33 @@ public static function is_special($tag_name)
* @param string $tag_name Name of HTML tag to check.
* @return bool Whether the given tag is an HTML Void Element.
*/
- public static function is_void($tag_name)
+ public static function is_void($tag_name) : bool
+ {
+ }
+ /**
+ * Gets an encoding from a given string.
+ *
+ * This is an algorithm defined in the WHAT-WG specification.
+ *
+ * Example:
+ *
+ * 'UTF-8' === self::get_encoding( 'utf8' );
+ * 'UTF-8' === self::get_encoding( " \tUTF-8 " );
+ * null === self::get_encoding( 'UTF-7' );
+ * null === self::get_encoding( 'utf8; charset=' );
+ *
+ * @see https://encoding.spec.whatwg.org/#concept-encoding-get
+ *
+ * @todo As this parser only supports UTF-8, only the UTF-8
+ * encodings are detected. Add more as desired, but the
+ * parser will bail on non-UTF-8 encodings.
+ *
+ * @since 6.7.0
+ *
+ * @param string $label A string which may specify a known encoding.
+ * @return string|null Known encoding if matched, otherwise null.
+ */
+ protected static function get_encoding(string $label) : ?string
{
}
/*
@@ -64294,7 +66768,7 @@ class WP_HTML_Span
* @param int $start Byte offset into document where replacement span begins.
* @param int $length Byte length of span.
*/
- public function __construct($start, $length)
+ public function __construct(int $start, int $length)
{
}
}
@@ -64361,7 +66835,7 @@ class WP_HTML_Stack_Event
* @param string $operation One of self::PUSH or self::POP.
* @param string $provenance "virtual" or "real".
*/
- public function __construct($token, $operation, $provenance)
+ public function __construct(\WP_HTML_Token $token, string $operation, string $provenance)
{
}
}
@@ -64412,7 +66886,7 @@ class WP_HTML_Text_Replacement
* @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, $length, $text)
+ public function __construct(int $start, int $length, string $text)
{
}
}
@@ -64467,6 +66941,22 @@ class WP_HTML_Token
* @var bool
*/
public $has_self_closing_flag = \false;
+ /**
+ * Indicates if the element is an HTML element or if it's inside foreign content.
+ *
+ * @since 6.7.0
+ *
+ * @var string 'html', 'svg', or 'math'.
+ */
+ public $namespace = 'html';
+ /**
+ * Indicates which kind of integration point the element is, if any.
+ *
+ * @since 6.7.0
+ *
+ * @var string|null 'math', 'html', or null if not an integration point.
+ */
+ public $integration_node_type = \null;
/**
* Called when token is garbage-collected or otherwise destroyed.
*
@@ -64478,12 +66968,13 @@ class WP_HTML_Token
*
* @since 6.4.0
*
- * @param string $bookmark_name Name of bookmark corresponding to location in HTML where token is found.
- * @param string $node_name Name of node token represents; if uppercase, an HTML element; if lowercase, a special value like "marker".
- * @param bool $has_self_closing_flag Whether the source token contains the self-closing flag, regardless of whether it's valid.
- * @param callable $on_destroy Function to call when destroying token, useful for releasing the bookmark.
+ * @param string|null $bookmark_name Name of bookmark corresponding to location in HTML where token is found,
+ * or `null` for markers and nodes without a bookmark.
+ * @param string $node_name Name of node token represents; if uppercase, an HTML element; if lowercase, a special value like "marker".
+ * @param bool $has_self_closing_flag Whether the source token contains the self-closing flag, regardless of whether it's valid.
+ * @param callable|null $on_destroy Optional. Function to call when destroying token, useful for releasing the bookmark.
*/
- public function __construct($bookmark_name, $node_name, $has_self_closing_flag, $on_destroy = \null)
+ public function __construct(?string $bookmark_name, string $node_name, bool $has_self_closing_flag, ?callable $on_destroy = \null)
{
}
/**
@@ -64517,6 +67008,7 @@ public function __wakeup()
* operation and signify that the given HTML cannot be processed.
*
* @since 6.4.0
+ * @since 6.7.0 Gained contextual information for use in debugging parse failures.
*
* @access private
*
@@ -64524,6 +67016,78 @@ public function __wakeup()
*/
class WP_HTML_Unsupported_Exception extends \Exception
{
+ /**
+ * Name of the matched token when the exception was raised,
+ * if matched on a token.
+ *
+ * This does not imply that the token itself was unsupported, but it
+ * may have been the case that the token triggered part of the HTML
+ * parsing that isn't supported, such as the adoption agency algorithm.
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ public $token_name;
+ /**
+ * Number of bytes into the input HTML document where the parser was
+ * parsing when the exception was raised.
+ *
+ * Use this to reconstruct context for the failure.
+ *
+ * @since 6.7.0
+ *
+ * @var int
+ */
+ public $token_at;
+ /**
+ * Full raw text of the matched token when the exception was raised,
+ * if matched on a token.
+ *
+ * Whereas the `$token_name` will be normalized, this contains the full
+ * raw text of the token, including original casing, duplicated attributes,
+ * and other syntactic variations that are normally abstracted in the HTML API.
+ *
+ * @since 6.7.0
+ *
+ * @var string
+ */
+ public $token;
+ /**
+ * Stack of open elements when the exception was raised.
+ *
+ * Use this to trace the parsing circumstances which led to the exception.
+ *
+ * @since 6.7.0
+ *
+ * @var string[]
+ */
+ public $stack_of_open_elements = array();
+ /**
+ * List of active formatting elements when the exception was raised.
+ *
+ * Use this to trace the parsing circumstances which led to the exception.
+ *
+ * @since 6.7.0
+ *
+ * @var string[]
+ */
+ public $active_formatting_elements = array();
+ /**
+ * Constructor function.
+ *
+ * @since 6.7.0
+ *
+ * @param string $message Brief message explaining what is unsupported, the reason this exception was raised.
+ * @param string $token_name Normalized name of matched token when this exception was raised.
+ * @param int $token_at Number of bytes into source HTML document where matched token starts.
+ * @param string $token Full raw text of matched token when this exception was raised.
+ * @param string[] $stack_of_open_elements Stack of open elements when this exception was raised.
+ * @param string[] $active_formatting_elements List of active formatting elements when this exception was raised.
+ */
+ public function __construct(string $message, string $token_name, int $token_at, string $token, array $stack_of_open_elements, array $active_formatting_elements)
+ {
+ }
}
/**
* Class used to iterate over the tags of an HTML string and help process the
@@ -64690,11 +67254,40 @@ public function config(string $store_namespace, array $config = array()) : array
* configuration will be available using a `getConfig` utility.
*
* @since 6.5.0
- * @phpstan-return void
+ *
+ * @deprecated 6.7.0 Client data passing is handled by the {@see "script_module_data_{$module_id}"} filter.
*/
public function print_client_interactivity_data()
{
}
+ /**
+ * Set client-side interactivity-router data.
+ *
+ * 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.7.0
+ *
+ * @param array $data Data to filter.
+ * @return array Data for the Interactivity Router script module.
+ */
+ public function filter_script_module_interactivity_router_data(array $data) : array
+ {
+ }
+ /**
+ * Set client-side interactivity data.
+ *
+ * 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.7.0
+ *
+ * @param array $data Data to filter.
+ * @return array Data for the Interactivity API script module.
+ */
+ public function filter_script_module_interactivity_data(array $data) : array
+ {
+ }
/**
* Returns the latest value on the context stack with the passed namespace.
*
@@ -64708,9 +67301,23 @@ public function print_client_interactivity_data()
public function get_context(?string $store_namespace = \null) : array
{
}
+ /**
+ * Returns an array representation of the current element being processed.
+ *
+ * The returned array contains a copy of the element attributes.
+ *
+ * @since 6.7.0
+ *
+ * @return array{attributes: array}|null Current element.
+ */
+ public function get_element() : ?array
+ {
+ }
/**
* Registers the `@wordpress/interactivity` script modules.
*
+ * @deprecated 6.7.0 Script Modules registration is handled by {@see wp_default_script_modules()}.
+ *
* @since 6.5.0
*/
public function register_script_modules()
@@ -64737,18 +67344,25 @@ 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.
+ * Deprecated.
*
* @since 6.5.0
+ * @deprecated 6.7.0 Use {@see WP_Interactivity_API::print_router_markup} instead.
*/
public function print_router_loading_and_screen_reader_markup()
{
}
+ /**
+ * Outputs markup for the @wordpress/interactivity-router script module.
+ *
+ * This method prints a div element representing a loading bar visible during
+ * navigation.
+ *
+ * @since 6.7.0
+ */
+ public function print_router_markup()
+ {
+ }
}
/**
* Class WP_Translation_Controller.
@@ -64902,6 +67516,19 @@ public function get_headers(string $textdomain = 'default') : array
public function get_entries(string $textdomain = 'default') : array
{
}
+ /**
+ * Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale.
+ *
+ * @since 6.7.0
+ *
+ * @param string $singular Singular translation to check.
+ * @param string $textdomain Optional. Text domain. Default 'default'.
+ * @param ?string $locale Optional. Locale. Default current locale.
+ * @return bool True if the translation exists, false otherwise.
+ */
+ public function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null) : bool
+ {
+ }
}
/**
* Class WP_Translation_File.
@@ -66489,7 +69116,7 @@ public function get_headers()
* Canonicalizes the header name.
*
* Ensures that header names are always treated the same regardless of
- * source. Header names are always case insensitive.
+ * source. Header names are always case-insensitive.
*
* Note that we treat `-` (dashes) and `_` (underscores) as the same
* character, as per header parsing rules in both Apache and nginx.
@@ -66837,7 +69464,7 @@ protected function parse_json_params()
* Parses the request body parameters.
*
* Parses out URL-encoded bodies for request methods that aren't supported
- * natively by PHP. In PHP 5.x, only POST has these parsed automatically.
+ * natively by PHP.
*
* @since 4.4.0
* @phpstan-return void
@@ -67354,6 +69981,18 @@ public function response_to_data($response, $embed)
public static function get_response_links($response)
{
}
+ /**
+ * Gets the target links for a REST API Link.
+ *
+ * @since 6.7.0
+ *
+ * @param array $link
+ *
+ * @return array|null
+ */
+ protected static function get_target_hints_for_link($link)
+ {
+ }
/**
* Retrieves the CURIEs (compact URIs) used for relations.
*
@@ -68418,7 +71057,7 @@ public function get_items_permissions_check($request)
*
* @param bool $required Whether the post requires a password check.
* @param WP_Post $post The post been password checked.
- * @return bool Result of password check taking in to account REST API considerations.
+ * @return bool Result of password check taking into account REST API considerations.
*/
public function check_password_required($required, $post)
{
@@ -68745,15 +71384,15 @@ public function prepare_item_for_response($item, $request)
{
}
/**
- * Overwrites the default protected title format.
+ * Overwrites the default protected and private title format.
*
- * By default, WordPress will show password protected posts with a title of
- * "Protected: %s", as the REST API communicates the protected status of a post
- * in a machine readable format, we remove the "Protected: " prefix.
+ * By default, WordPress will show password protected or private posts with a title of
+ * "Protected: %s" or "Private: %s", as the REST API communicates the status of a post
+ * in a machine-readable format, we remove the prefix.
*
* @since 4.7.0
*
- * @return string Protected title format.
+ * @return string Title format.
*/
public function protected_title_format()
{
@@ -68924,7 +71563,7 @@ public function update_item($request)
{
}
/**
- * Performs post processing on an attachment.
+ * Performs post-processing on an attachment.
*
* @since 5.3.0
*
@@ -68935,7 +71574,7 @@ public function post_process_item($request)
{
}
/**
- * Checks if a given request can perform post processing on an attachment.
+ * Checks if a given request can perform post-processing on an attachment.
*
* @since 5.3.0
*
@@ -69597,7 +72236,7 @@ public function get_items_permissions_check($request)
* @since 6.0.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_items($request)
{
@@ -70327,7 +72966,7 @@ public function register_routes()
*
* @since 5.9.0
*
- * @return WP_Error|true True if the request has access, or WP_Error object.
+ * @return true|WP_Error True if the request has access, or WP_Error object.
*/
public function permissions_check()
{
@@ -70338,7 +72977,7 @@ public function permissions_check()
*
* @since 5.9.0
*
- * @return WP_Error|void
+ * @return void|WP_Error
*/
public function export()
{
@@ -71062,6 +73701,7 @@ public function get_item_schema()
* Checks if a given request has access to read a single theme global styles config.
*
* @since 5.9.0
+ * @since 6.7.0 Allow users with edit post capabilities to view theme global styles.
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
@@ -71085,6 +73725,7 @@ public function get_theme_item($request)
* Checks if a given request has access to read a single theme global styles config.
*
* @since 6.0.0
+ * @since 6.7.0 Allow users with edit post capabilities to view theme global styles.
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
@@ -71282,7 +73923,7 @@ protected function check_has_read_only_access($request)
{
}
/**
- * Creates a single post.
+ * Creates a single nav menu item.
*
* @since 5.9.0
*
@@ -71304,7 +73945,7 @@ public function update_item($request)
{
}
/**
- * Deletes a single menu item.
+ * Deletes a single nav menu item.
*
* @since 5.9.0
*
@@ -71315,7 +73956,7 @@ public function delete_item($request)
{
}
/**
- * Prepares a single post for create or update.
+ * Prepares a single nav menu item for create or update.
*
* @since 5.9.0
*
@@ -71327,7 +73968,7 @@ protected function prepare_item_for_database($request)
{
}
/**
- * Prepares a single post output for response.
+ * Prepares a single nav menu item output for response.
*
* @since 5.9.0
*
@@ -71350,7 +73991,7 @@ protected function prepare_links($post)
{
}
/**
- * Retrieves Link Description Objects that should be added to the Schema for the posts collection.
+ * Retrieves Link Description Objects that should be added to the Schema for the nav menu items collection.
*
* @since 5.9.0
*
@@ -71360,7 +74001,7 @@ protected function get_schema_links()
{
}
/**
- * Retrieves the term's schema, conforming to JSON Schema.
+ * Retrieves the nav menu item's schema, conforming to JSON Schema.
*
* @since 5.9.0
*
@@ -71370,7 +74011,7 @@ public function get_item_schema()
{
}
/**
- * Retrieves the query params for the posts collection.
+ * Retrieves the query params for the nav menu items collection.
*
* @since 5.9.0
*
@@ -71437,7 +74078,7 @@ public function register_routes()
* @since 5.9.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
+ * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
*/
public function get_items_permissions_check($request)
{
@@ -71448,7 +74089,7 @@ public function get_items_permissions_check($request)
* @since 5.9.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_items($request)
{
@@ -71470,7 +74111,7 @@ public function get_item_permissions_check($request)
* @since 5.9.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_item($request)
{
@@ -71656,7 +74297,7 @@ public function get_item($request)
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return true|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
+ * @return bool|WP_Error True if the request has access to create items, otherwise false or WP_Error object.
*/
public function create_item_permissions_check($request)
{
@@ -72116,6 +74757,20 @@ public function get_item_schema()
public function get_collection_params()
{
}
+ /**
+ * Include a hash of the query args, so that different requests are stored in
+ * separate caches.
+ *
+ * MD5 is chosen for its speed, low-collision rate, universal availability, and to stay
+ * under the character limit for `_site_transient_timeout_{...}` keys.
+ *
+ * @link https://stackoverflow.com/questions/3665247/fastest-hash-for-non-cryptographic-uses
+ *
+ * @since 6.0.0
+ *
+ * @param array $query_args Query arguments to generate a transient key from.
+ * @return string Transient key.
+ */
protected function get_transient_key($query_args)
{
}
@@ -73281,7 +75936,7 @@ public function get_items($request)
* @since 4.7.0
*
* @param WP_REST_Request $request Full details about the request.
- * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
+ * @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
*/
public function get_item_permissions_check($request)
{
@@ -74007,7 +76662,7 @@ public function parse_url_details($request)
*
* @since 5.9.0
*
- * @return WP_Error|bool True if the request has permission, else WP_Error.
+ * @return true|WP_Error True if the request has permission, else WP_Error.
*/
public function permissions_check()
{
@@ -74590,7 +77245,7 @@ public function get_items_permissions_check($request)
* @since 5.8.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.
+ * @return WP_REST_Response Response object.
*/
public function get_items($request)
{
@@ -74888,6 +77543,7 @@ protected function delete_meta_value($object_id, $meta_key, $name)
* Alters the list of values in the database to match the list of provided values.
*
* @since 4.7.0
+ * @since 6.7.0 Stores values into DB even if provided registered default value.
*
* @param int $object_id Object ID to update.
* @param string $meta_key Key for the custom field.
@@ -74902,6 +77558,7 @@ protected function update_multi_meta_value($object_id, $meta_key, $name, $values
* Updates a meta value for an object.
*
* @since 4.7.0
+ * @since 6.7.0 Stores values into DB even if provided registered default value.
*
* @param int $object_id Object ID to update.
* @param string $meta_key Key for the custom field.
@@ -75431,15 +78088,15 @@ public function prepare_item_links($id)
{
}
/**
- * Overwrites the default protected title format.
+ * Overwrites the default protected and private title format.
*
- * By default, WordPress will show password protected posts with a title of
- * "Protected: %s". As the REST API communicates the protected status of a post
- * in a machine readable format, we remove the "Protected: " prefix.
+ * By default, WordPress will show password protected or private posts with a title of
+ * "Protected: %s" or "Private: %s", as the REST API communicates the status of a post
+ * in a machine-readable format, we remove the prefix.
*
* @since 5.0.0
*
- * @return string Protected title format.
+ * @return string Title format.
*/
public function protected_title_format()
{
@@ -75954,6 +78611,7 @@ public function render_sitemaps()
* Redirects a URL to the wp-sitemap.xml
*
* @since 5.5.0
+ * @deprecated 6.7.0 Deprecated in favor of {@see WP_Rewrite::rewrite_rules()}
*
* @param bool $bypass Pass-through of the pre_handle_404 filter value.
* @param WP_Query $query The WP_Query object.
@@ -76629,6 +79287,7 @@ public function get_css($options = array())
* @since 6.4.0 Added support for background.backgroundImage.
* @since 6.5.0 Added support for background.backgroundPosition,
* background.backgroundRepeat and dimensions.aspectRatio.
+ * @since 6.7.0 Added support for typography.writingMode.
*/
#[\AllowDynamicProperties]
final class WP_Style_Engine
@@ -76653,7 +79312,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')), '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'))));
+ 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')), 'backgroundAttachment' => array('property_keys' => array('default' => 'background-attachment'), 'path' => array('background', 'backgroundAttachment'))), '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')), 'writingMode' => array('property_keys' => array('default' => 'writing-mode'), 'path' => array('typography', 'writingMode'))));
/**
* Stores a CSS rule using the provided CSS selector and CSS declarations.
*
@@ -81815,6 +84474,7 @@ function wp_copy_parent_attachment_properties($cropped, $parent_attachment_id, $
*
* @since 2.1.0
* @since 6.0.0 The `$filesize` value was added to the returned array.
+ * @since 6.7.0 The 'image/heic' mime type is supported.
*
* @param int $attachment_id Attachment ID to process.
* @param string $file Filepath of the attached image.
@@ -84153,34 +86813,33 @@ function options_reading_blog_charset()
*
* The second filter, {@see 'plugins_api'}, allows a plugin to override the WordPress.org
* Plugin Installation API entirely. If `$action` is 'query_plugins' or 'plugin_information',
- * an object MUST be passed. If `$action` is 'hot_tags' or 'hot_categories', an array MUST
- * be passed.
+ * an object MUST be passed. If `$action` is 'hot_tags', an array MUST be passed.
*
* Finally, the third filter, {@see 'plugins_api_result'}, makes it possible to filter the
* response object or array, depending on the `$action` type.
*
* Supported arguments per action:
*
- * | Argument Name | query_plugins | plugin_information | hot_tags | hot_categories |
- * | -------------------- | :-----------: | :----------------: | :------: | :------------: |
- * | `$slug` | No | Yes | No | No |
- * | `$per_page` | Yes | No | No | No |
- * | `$page` | Yes | No | No | No |
- * | `$number` | No | No | Yes | Yes |
- * | `$search` | Yes | No | No | No |
- * | `$tag` | Yes | No | No | No |
- * | `$author` | Yes | No | No | No |
- * | `$user` | Yes | No | No | No |
- * | `$browse` | Yes | No | No | No |
- * | `$locale` | Yes | Yes | No | No |
- * | `$installed_plugins` | Yes | No | No | No |
- * | `$is_ssl` | Yes | Yes | No | No |
- * | `$fields` | Yes | Yes | No | No |
+ * | Argument Name | query_plugins | plugin_information | hot_tags |
+ * | -------------------- | :-----------: | :----------------: | :------: |
+ * | `$slug` | No | Yes | No |
+ * | `$per_page` | Yes | No | No |
+ * | `$page` | Yes | No | No |
+ * | `$number` | No | No | Yes |
+ * | `$search` | Yes | No | No |
+ * | `$tag` | Yes | No | No |
+ * | `$author` | Yes | No | No |
+ * | `$user` | Yes | No | No |
+ * | `$browse` | Yes | No | No |
+ * | `$locale` | Yes | Yes | No |
+ * | `$installed_plugins` | Yes | No | No |
+ * | `$is_ssl` | Yes | Yes | No |
+ * | `$fields` | Yes | Yes | No |
*
* @since 2.7.0
*
* @param string $action API action to perform: 'query_plugins', 'plugin_information',
- * 'hot_tags' or 'hot_categories'.
+ * or 'hot_tags'.
* @param array|object $args {
* Optional. Array or object of arguments to serialize for the Plugin Info API.
*
@@ -84224,14 +86883,13 @@ function options_reading_blog_charset()
* @type bool $banners Whether to return the banner images links. Default false.
* @type bool $icons Whether to return the icon links. Default false.
* @type bool $active_installs Whether to return the number of active installations. Default false.
- * @type bool $group Whether to return the assigned group. Default false.
* @type bool $contributors Whether to return the list of contributors. Default false.
* }
* }
* @return object|array|WP_Error Response object or array on success, WP_Error on failure. See the
* {@link https://developer.wordpress.org/reference/functions/plugins_api/ function reference article}
* for more information on the make-up of possible return values depending on the value of `$action`.
- * @phpstan-param 'query_plugins'|'plugin_information'|'hot_tags'|'hot_categories' $action
+ * @phpstan-param 'query_plugins'|'plugin_information'|'hot_tags' $action
* @phpstan-param object|array{
* slug?: string,
* per_page?: int,
@@ -84267,7 +86925,6 @@ function options_reading_blog_charset()
* banners?: bool,
* icons?: bool,
* active_installs?: bool,
- * group?: bool,
* contributors?: bool,
* },
* } $args
@@ -85847,7 +88504,7 @@ function wp_create_post_autosave($post_data)
{
}
/**
- * Autosave the revisioned meta fields.
+ * Autosaves the revisioned meta fields.
*
* Iterates through the revisioned meta fields and checks each to see if they are set,
* and have a changed value. If so, the meta value is saved and attached to the autosave.
@@ -87815,7 +90472,36 @@ function paused_themes_notice()
*
* @param string $type Type of translations. Accepts 'plugins', 'themes', 'core'.
* @param array|object $args Translation API arguments. Optional.
- * @return array|WP_Error On success an associative array of translations, WP_Error on failure.
+ * @return array|WP_Error {
+ * On success an associative array of translations, WP_Error on failure.
+ *
+ * @type array $translations {
+ * List of translations, each an array of data.
+ *
+ * @type array ...$0 {
+ * @type string $language Language code.
+ * @type string $version WordPress version.
+ * @type string $updated Date the translation was last updated, in MySQL datetime format.
+ * @type string $english_name English name of the language.
+ * @type string $native_name Native name of the language.
+ * @type string $package URL to download the translation package.
+ * @type string[] $iso Array of ISO language codes.
+ * @type array $strings Array of translated strings used in the installation process.
+ * }
+ * }
+ * }
+ * @phpstan-return \WP_Error|array{
+ * translations: array,
+ * }
*/
function translations_api($type, $args = \null)
{
@@ -87827,8 +90513,31 @@ function translations_api($type, $args = \null)
*
* @see translations_api()
*
- * @return array[] Array of translations, each an array of data, keyed by the language. If the API response results
- * in an error, an empty array will be returned.
+ * @return array {
+ * Array of translations keyed by the language code, each an associative array of data.
+ * If the API response results in an error, an empty array will be returned.
+ *
+ * @type array ...$0 {
+ * @type string $language Language code.
+ * @type string $version WordPress version.
+ * @type string $updated Date the translation was last updated, in MySQL datetime format.
+ * @type string $english_name English name of the language.
+ * @type string $native_name Native name of the language.
+ * @type string $package URL to download the translation package.
+ * @type string[] $iso Array of ISO language codes.
+ * @type array $strings Array of translated strings used in the installation process.
+ * }
+ * }
+ * @phpstan-return array
*/
function wp_get_available_translations()
{
@@ -88379,8 +91088,8 @@ function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password)
*
* @since 2.1.0
*
- * @global int $wp_current_db_version The old (current) database version.
- * @global int $wp_db_version The new database version.
+ * @global int $wp_current_db_version The old (current) database version.
+ * @global int $wp_db_version The new database version.
* @phpstan-return void
*/
function wp_upgrade()
@@ -88862,6 +91571,17 @@ function upgrade_640()
function upgrade_650()
{
}
+ /**
+ * Executes changes made in WordPress 6.7.0.
+ *
+ * @ignore
+ * @since 6.7.0
+ *
+ * @global int $wp_current_db_version The old (current) database version.
+ */
+ function upgrade_670()
+ {
+ }
/**
* Executes network-level upgrade routines.
*
@@ -90705,6 +93425,7 @@ function wp_register_background_support($block_type)
* @since 6.4.0
* @since 6.5.0 Added support for `backgroundPosition` and `backgroundRepeat` output.
* @since 6.6.0 Removed requirement for `backgroundImage.source`. A file/url is the default.
+ * @since 6.7.0 Added support for `backgroundAttachment` output.
*
* @access private
*
@@ -90715,20 +93436,6 @@ function wp_register_background_support($block_type)
function wp_render_background_support($block_content, $block)
{
}
- /**
- * Generate block style variation instance name.
- *
- * @since 6.6.0
- * @access private
- *
- * @param array $block Block object.
- * @param string $variation Slug for the block style variation.
- *
- * @return string The unique variation name.
- */
- function wp_create_block_style_variation_instance_name($block, $variation)
- {
- }
/**
* Determines the block style variation names within a CSS class string.
*
@@ -91126,6 +93833,7 @@ function wp_add_parent_layout_to_parsed_block($parsed_block, $source_block, $par
* to avoid breaking styles relying on that div.
*
* @since 5.8.0
+ * @since 6.6.1 Removed inner container from Grid variations.
* @access private
*
* @param string $block_content Rendered block content.
@@ -91401,6 +94109,7 @@ function wp_get_computed_fluid_typography_value($args = array())
* @since 6.3.0 Using layout.wideSize as max viewport width, and logarithmic scale factor to calculate minimum font scale.
* @since 6.4.0 Added configurable min and max viewport width values to the typography.fluid theme.json schema.
* @since 6.6.0 Deprecated bool argument $should_use_fluid_typography.
+ * @since 6.7.0 Font size presets can enable fluid typography individually, even if it’s disabled globally.
*
* @param array $preset {
* Required. fontSizes preset value as seen in theme.json.
@@ -91589,7 +94298,7 @@ function _get_block_template_file($template_type, $slug)
* @type string $post_type Post type to get the templates for.
* }
*
- * @return array Template
+ * @return array|null Template files on success, null if `$template_type` is not matched.
* @phpstan-param 'wp_template'|'wp_template_part' $template_type
* @phpstan-param array{
* slug__in?: string[],
@@ -91842,8 +94551,6 @@ function wp_is_theme_directory_ignored($path)
* @since 5.9.0
* @since 6.0.0 Adds the whole theme to the export archive.
*
- * @global string $wp_version The WordPress version string.
- *
* @return WP_Error|string Path of the ZIP file or error on failure.
*/
function wp_generate_block_templates_export_file()
@@ -92008,6 +94715,46 @@ function _block_template_render_without_post_block_context($context)
function _resolve_template_for_new_post($wp_query)
{
}
+ /**
+ * Register a block template.
+ *
+ * @since 6.7.0
+ *
+ * @param string $template_name Template name in the form of `plugin_uri//template_name`.
+ * @param array|string $args {
+ * @type string $title Optional. Title of the template as it will be shown in the Site Editor
+ * and other UI elements.
+ * @type string $description Optional. Description of the template as it will be shown in the Site
+ * Editor.
+ * @type string $content Optional. Default content of the template that will be used when the
+ * template is rendered or edited in the editor.
+ * @type string[] $post_types Optional. Array of post types to which the template should be available.
+ * @type string $plugin Optional. Slug of the plugin that registers the template.
+ * }
+ * @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure.
+ * @phpstan-param array{
+ * title?: string,
+ * description?: string,
+ * content?: string,
+ * post_types?: string[],
+ * plugin?: string,
+ * } $args
+ */
+ function register_block_template($template_name, $args = array())
+ {
+ }
+ /**
+ * Unregister a block template.
+ *
+ * @since 6.7.0
+ *
+ * @param string $template_name Template name in the form of `plugin_uri//template_name`.
+ * @return WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if the
+ * template doesn't exist.
+ */
+ function unregister_block_template($template_name)
+ {
+ }
/**
* Removes the block asset's path prefix if provided.
*
@@ -92113,6 +94860,21 @@ function register_block_style_handle($metadata, $field_name, $index = 0)
function get_block_metadata_i18n_schema()
{
}
+ /**
+ * Registers a block metadata collection.
+ *
+ * This function allows core and third-party plugins to register their block metadata
+ * collections in a centralized location. Registering collections can improve performance
+ * by avoiding multiple reads from the filesystem and parsing JSON.
+ *
+ * @since 6.7.0
+ *
+ * @param string $path The base path in which block files for the collection reside.
+ * @param string $manifest The path to the manifest file for the collection.
+ */
+ function wp_register_block_metadata_collection($path, $manifest)
+ {
+ }
/**
* Registers a block type from the metadata stored in the `block.json` file.
*
@@ -92123,6 +94885,7 @@ function get_block_metadata_i18n_schema()
* @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.
+ * @since 6.7.0 Allow PHP filename as `variations` argument.
*
* @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.
@@ -92324,6 +95087,7 @@ function set_ignored_hooked_blocks_metadata(&$parsed_anchor_block, $relative_pos
* Runs the hooked blocks algorithm on the given content.
*
* @since 6.6.0
+ * @since 6.7.0 Injects the `theme` attribute into Template Part blocks, even if no hooked blocks are registered.
* @access private
*
* @param string $content Serialized content.
@@ -92349,6 +95113,20 @@ function apply_block_hooks_to_content($content, $context, $callback = 'insert_ho
function remove_serialized_parent_block($serialized_block)
{
}
+ /**
+ * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the wrapper block.
+ *
+ * @since 6.7.0
+ * @access private
+ *
+ * @see remove_serialized_parent_block()
+ *
+ * @param string $serialized_block The serialized markup of a block and its inner blocks.
+ * @return string The serialized markup of the wrapper block.
+ */
+ function extract_serialized_parent_block($serialized_block)
+ {
+ }
/**
* Updates the wp_postmeta with the list of ignored hooked blocks where the inner blocks are stored as post content.
* Currently only supports `wp_navigation` post types.
@@ -92503,7 +95281,7 @@ function get_comment_delimited_block_content($block_name, $block_attributes, $bl
* @since 5.3.1
*
* @param array $block {
- * A representative array of a single parsed block object. See WP_Block_Parser_Block.
+ * An associative array of a single parsed block object. See WP_Block_Parser_Block.
*
* @type string $blockName Name of block.
* @type array $attrs Attributes from block comment delimiters.
@@ -92535,7 +95313,7 @@ function serialize_block($block)
* Array of block structures.
*
* @type array ...$0 {
- * A representative array of a single parsed block object. See WP_Block_Parser_Block.
+ * An associative array of a single parsed block object. See WP_Block_Parser_Block.
*
* @type string $blockName Name of block.
* @type array $attrs Attributes from block comment delimiters.
@@ -92583,7 +95361,7 @@ function serialize_blocks($blocks)
*
* @see serialize_block()
*
- * @param array $block A representative array of a single parsed block object. See WP_Block_Parser_Block.
+ * @param array $block An associative array of a single parsed block object. See WP_Block_Parser_Block.
* @param callable $pre_callback Callback to run on each block in the tree before it is traversed and serialized.
* It is called with the following arguments: &$block, $parent_block, $previous_block.
* Its string return value will be prepended to the serialized block markup.
@@ -92773,7 +95551,7 @@ function _excerpt_render_inner_blocks($parsed_block, $allowed_blocks)
* @global WP_Post $post The post to edit.
*
* @param array $parsed_block {
- * A representative array of the block being rendered. See WP_Block_Parser_Block.
+ * An associative array of the block being rendered. See WP_Block_Parser_Block.
*
* @type string $blockName Name of block.
* @type array $attrs Attributes from block comment delimiters.
@@ -92805,7 +95583,7 @@ function render_block($parsed_block)
* Array of block structures.
*
* @type array ...$0 {
- * A representative array of a single parsed block object. See WP_Block_Parser_Block.
+ * An associative array of a single parsed block object. See WP_Block_Parser_Block.
*
* @type string $blockName Name of block.
* @type array $attrs Attributes from block comment delimiters.
@@ -92938,6 +95716,7 @@ function wp_migrate_old_typography_shape($metadata)
*
* @since 5.8.0
* @since 6.1.0 Added `query_loop_block_query_vars` filter and `parents` support in query.
+ * @since 6.7.0 Added support for the `format` property in query.
*
* @param WP_Block $block Block instance.
* @param int $page Current query's page.
@@ -93230,12 +96009,15 @@ function block_core_calendar_update_has_published_post_on_transition_post_status
* Renders the `core/categories` block on server.
*
* @since 5.0.0
+ * @since 6.7.0 Enable client-side rendering if enhancedPagination context is true.
*
- * @param array $attributes The block attributes.
+ * @param array $attributes The block attributes.
+ * @param string $content Block default content.
+ * @param WP_Block $block Block instance.
*
* @return string Returns the categories list/dropdown markup.
*/
- function render_block_core_categories($attributes)
+ function render_block_core_categories($attributes, $content, $block)
{
}
/**
@@ -93862,8 +96644,6 @@ function register_block_core_image()
* avoids unnecessary logic and filesystem lookups in the other function.
*
* @since 6.3.0
- *
- * @global string $wp_version The WordPress version string.
*/
function register_core_block_style_handles()
{
@@ -93877,6 +96657,18 @@ function register_core_block_style_handles()
function register_core_block_types_from_metadata()
{
}
+ /**
+ * Registers the core block metadata collection.
+ *
+ * This function is hooked into the 'init' action with a priority of 9,
+ * ensuring that the core block metadata is registered before the regular
+ * block initialization that happens at priority 10.
+ *
+ * @since 6.7.0
+ */
+ function wp_register_core_block_metadata_collection()
+ {
+ }
/**
* Get the post title.
*
@@ -95420,6 +98212,8 @@ function _sync_custom_logo_to_site_logo($value)
*
* @since 5.8.0
*
+ * @global array $_ignore_site_logo_changes
+ *
* @param array $old_value Previous theme mod settings.
* @param array $value Updated theme mod settings.
* @phpstan-return void
@@ -95431,6 +98225,8 @@ function _delete_site_logo_on_remove_custom_logo($old_value, $value)
* Deletes the site logo when all theme mods are being removed.
*
* @since 5.8.0
+ *
+ * @global array $_ignore_site_logo_changes
* @phpstan-return void
*/
function _delete_site_logo_on_remove_theme_mods()
@@ -95451,6 +98247,8 @@ function _delete_site_logo_on_remove_custom_logo_on_setup_theme()
* Removes the custom_logo theme-mod when the site_logo option gets deleted.
*
* @since 5.9.0
+ *
+ * @global array $_ignore_site_logo_changes
*/
function _delete_custom_logo_on_remove_site_logo()
{
@@ -96442,6 +99240,7 @@ function wp_redirect_admin_locations()
* @since 5.7.0 Added the `create_app_password`, `list_app_passwords`, `read_app_password`,
* `edit_app_password`, `delete_app_passwords`, `delete_app_password`,
* and `update_https` capabilities.
+ * @since 6.7.0 Added the `edit_block_binding` capability.
*
* @global array $post_type_meta_caps Used to get post type meta capabilities.
*
@@ -96494,23 +99293,22 @@ function current_user_can($capability, ...$args)
* capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to
* map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.
*
+ * This function replaces the current_user_can_for_blog() function.
+ *
* Example usage:
*
- * current_user_can_for_blog( $blog_id, 'edit_posts' );
- * current_user_can_for_blog( $blog_id, 'edit_post', $post->ID );
- * current_user_can_for_blog( $blog_id, 'edit_post_meta', $post->ID, $meta_key );
+ * current_user_can_for_site( $site_id, 'edit_posts' );
+ * current_user_can_for_site( $site_id, 'edit_post', $post->ID );
+ * current_user_can_for_site( $site_id, 'edit_post_meta', $post->ID, $meta_key );
*
- * @since 3.0.0
- * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
- * by adding it to the function signature.
- * @since 5.8.0 Wraps current_user_can() after switching to blog.
+ * @since 6.7.0
*
- * @param int $blog_id Site ID.
+ * @param int $site_id Site ID.
* @param string $capability Capability name.
* @param mixed ...$args Optional further parameters, typically starting with an object ID.
* @return bool Whether the user has the given capability.
*/
- function current_user_can_for_blog($blog_id, $capability, ...$args)
+ function current_user_can_for_site($site_id, $capability, ...$args)
{
}
/**
@@ -96563,6 +99361,30 @@ function author_can($post, $capability, ...$args)
function user_can($user, $capability, ...$args)
{
}
+ /**
+ * Returns whether a particular user has the specified capability for a given site.
+ *
+ * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta
+ * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to
+ * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.
+ *
+ * Example usage:
+ *
+ * user_can_for_site( $user->ID, $site_id, 'edit_posts' );
+ * user_can_for_site( $user->ID, $site_id, 'edit_post', $post->ID );
+ * user_can_for_site( $user->ID, $site_id, 'edit_post_meta', $post->ID, $meta_key );
+ *
+ * @since 6.7.0
+ *
+ * @param int|WP_User $user User ID or object.
+ * @param int $site_id Site ID.
+ * @param string $capability Capability name.
+ * @param mixed ...$args Optional further parameters, typically starting with an object ID.
+ * @return bool Whether the user has the given capability.
+ */
+ function user_can_for_site($user, $site_id, $capability, ...$args)
+ {
+ }
/**
* Retrieves the global WP_Roles instance and instantiates it if necessary.
*
@@ -96921,7 +99743,6 @@ function category_description($category = 0)
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -97663,9 +100484,9 @@ function _make_cat_compat(&$category)
* WordPress autoloader for SimplePie.
*
* @since 3.5.0
+ * @deprecated 6.7.0 Use `SimplePie_Autoloader` instead.
*
* @param string $class Class name.
- * @phpstan-return void
*/
function wp_simplepie_autoload($class)
{
@@ -98416,19 +101237,23 @@ function comments_popup_link($zero = \false, $one = \false, $more = \false, $css
* @param array $args {
* Optional. Override default arguments.
*
- * @type string $add_below The first part of the selector used to identify the comment to respond below.
- * The resulting value is passed as the first parameter to addComment.moveForm(),
- * concatenated as $add_below-$comment->comment_ID. Default 'comment'.
- * @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
- * to addComment.moveForm(), and appended to the link URL as a hash value.
- * Default 'respond'.
- * @type string $reply_text The text of the Reply link. Default 'Reply'.
- * @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'.
- * @type int $max_depth The max depth of the comment tree. Default 0.
- * @type int $depth The depth of the new comment. Must be greater than 0 and less than the value
- * of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.
- * @type string $before The text or HTML to add before the reply link. Default empty.
- * @type string $after The text or HTML to add after the reply link. Default empty.
+ * @type string $add_below The first part of the selector used to identify the comment to respond below.
+ * The resulting value is passed as the first parameter to addComment.moveForm(),
+ * concatenated as $add_below-$comment->comment_ID. Default 'comment'.
+ * @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
+ * to addComment.moveForm(), and appended to the link URL as a hash value.
+ * Default 'respond'.
+ * @type string $reply_text The visible text of the Reply link. Default 'Reply'.
+ * @type string $reply_to_text The accessible name of the Reply link, using `%s` as a placeholder
+ * for the comment author's name. Default 'Reply to %s'.
+ * Should start with the visible `reply_text` value.
+ * @type bool $show_reply_to_text Whether to use `reply_to_text` as visible link text. Default false.
+ * @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'.
+ * @type int $max_depth The max depth of the comment tree. Default 0.
+ * @type int $depth The depth of the new comment. Must be greater than 0 and less than the value
+ * of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.
+ * @type string $before The text or HTML to add before the reply link. Default empty.
+ * @type string $after The text or HTML to add after the reply link. Default empty.
* }
* @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
@@ -98438,6 +101263,8 @@ function comments_popup_link($zero = \false, $one = \false, $more = \false, $css
* add_below?: string,
* respond_id?: string,
* reply_text?: string,
+ * reply_to_text?: string,
+ * show_reply_to_text?: bool,
* login_text?: string,
* max_depth?: int,
* depth?: int,
@@ -98582,15 +101409,15 @@ function comment_id_fields($post = \null)
*
* @global WP_Comment $comment Global comment object.
*
- * @param string|false $no_reply_text Optional. Text to display when not replying to a comment.
- * Default false.
- * @param string|false $reply_text Optional. Text to display when replying to a comment.
- * Default false. Accepts "%s" for the author of the comment
- * being replied to.
- * @param bool $link_to_parent Optional. Boolean to control making the author's name a link
- * to their comment. Default true.
- * @param int|WP_Post|null $post Optional. The post that the comment form is being displayed for.
- * Defaults to the current global post.
+ * @param string|false $no_reply_text Optional. Text to display when not replying to a comment.
+ * Default false.
+ * @param string|false $reply_text Optional. Text to display when replying to a comment.
+ * Default false. Accepts "%s" for the author of the comment
+ * being replied to.
+ * @param bool $link_to_parent Optional. Boolean to control making the author's name a link
+ * to their comment. Default true.
+ * @param int|WP_Post|null $post Optional. The post that the comment form is being displayed for.
+ * Defaults to the current global post.
* @phpstan-return void
*/
function comment_form_title($no_reply_text = \false, $reply_text = \false, $link_to_parent = \true, $post = \null)
@@ -99090,7 +101917,8 @@ function delete_comment_meta($comment_id, $meta_key, $meta_value = '')
* @return mixed An array of values if `$single` is false.
* The value of meta data field if `$single` is true.
* False for an invalid `$comment_id` (non-numeric, zero, or negative value).
- * An empty string if a valid but non-existing comment ID is passed.
+ * An empty array if a valid but non-existing comment ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing comment ID is passed and `$single` is true.
*/
function get_comment_meta($comment_id, $key = '', $single = \false)
{
@@ -99295,6 +102123,20 @@ function wp_get_comment_fields_max_lengths()
function wp_check_comment_data_max_lengths($comment_data)
{
}
+ /**
+ * Checks whether comment data passes internal checks or has disallowed content.
+ *
+ * @since 6.7.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param array $comment_data Array of arguments for inserting a comment.
+ * @return int|string|WP_Error The approval status on success (0|1|'spam'|'trash'),
+ * WP_Error otherwise.
+ */
+ function wp_check_comment_data($comment_data)
+ {
+ }
/**
* Checks if a comment contains disallowed characters or words.
*
@@ -104069,6 +106911,60 @@ function wp_render_elements_support($block_content, $block)
function wp_interactivity_process_directives_of_interactive_blocks(array $parsed_block) : array
{
}
+ /**
+ * Gets the global styles custom CSS from theme.json.
+ *
+ * @since 6.2.0
+ * @deprecated 6.7.0 Use {@see 'wp_get_global_stylesheet'} instead.
+ *
+ * @return string The global styles custom CSS.
+ */
+ function wp_get_global_styles_custom_css()
+ {
+ }
+ /**
+ * Enqueues the global styles custom css defined via theme.json.
+ *
+ * @since 6.2.0
+ * @deprecated 6.7.0 Use {@see 'wp_enqueue_global_styles'} instead.
+ * @phpstan-return void
+ */
+ function wp_enqueue_global_styles_custom_css()
+ {
+ }
+ /**
+ * Generate block style variation instance name.
+ *
+ * @since 6.6.0
+ * @deprecated 6.7.0 Use `wp_unique_id( $variation . '--' )` instead.
+ *
+ * @access private
+ *
+ * @param array $block Block object.
+ * @param string $variation Slug for the block style variation.
+ *
+ * @return string The unique variation name.
+ */
+ function wp_create_block_style_variation_instance_name($block, $variation)
+ {
+ }
+ /**
+ * Returns whether the current user has the specified capability for a given site.
+ *
+ * @since 3.0.0
+ * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
+ * by adding it to the function signature.
+ * @since 5.8.0 Wraps current_user_can() after switching to blog.
+ * @deprecated 6.7.0 Use current_user_can_for_site() instead.
+ *
+ * @param int $blog_id Site ID.
+ * @param string $capability Capability name.
+ * @param mixed ...$args Optional further parameters, typically starting with an object ID.
+ * @return bool Whether the user has the given capability.
+ */
+ function current_user_can_for_blog($blog_id, $capability, ...$args)
+ {
+ }
/**
* Registers an embed handler.
*
@@ -105011,7 +107907,7 @@ function feed_content_type($type = '')
* @param string|string[] $url URL of feed to retrieve. If an array of URLs, the feeds are merged
* using SimplePie's multifeed feature.
* See also {@link http://simplepie.org/wiki/faq/typical_multifeed_gotchas}
- * @return SimplePie|WP_Error SimplePie object on success or WP_Error object on failure.
+ * @return SimplePie\SimplePie|WP_Error SimplePie object on success or WP_Error object on failure.
*/
function fetch_feed($url)
{
@@ -105071,6 +107967,16 @@ function fetch_feed($url)
function wp_print_font_faces($fonts = array())
{
}
+ /**
+ * Generates and prints font-face styles defined the the theme style variations.
+ *
+ * @since 6.7.0
+ *
+ * @phpstan-return void
+ */
+ function wp_print_font_faces_from_style_variations()
+ {
+ }
/**
* Registers a new font collection in the font library.
*
@@ -106401,6 +109307,7 @@ function wp_rel_ugc($text)
*
* @since 5.1.0
* @since 5.6.0 Removed 'noreferrer' relationship.
+ * @deprecated 6.7.0
*
* @param string $text Content that may contain HTML A elements.
* @return string Converted content.
@@ -106415,6 +109322,7 @@ function wp_targeted_link_rel($text)
*
* @since 5.1.0
* @since 5.6.0 Removed 'noreferrer' relationship.
+ * @deprecated 6.7.0
*
* @param array $matches Single match.
* @return string HTML A Element with `rel="noopener"` in addition to any existing values.
@@ -106426,6 +109334,7 @@ function wp_targeted_link_rel_callback($matches)
* Adds all filters modifying the rel attribute of targeted links.
*
* @since 5.1.0
+ * @deprecated 6.7.0
*/
function wp_init_targeted_link_rel_filters()
{
@@ -106434,6 +109343,7 @@ function wp_init_targeted_link_rel_filters()
* Removes all filters modifying the rel attribute of targeted links.
*
* @since 5.1.0
+ * @deprecated 6.7.0
*/
function wp_remove_targeted_link_rel_filters()
{
@@ -106577,7 +109487,7 @@ function sanitize_email($email)
* Determines the difference between two timestamps.
*
* The difference is returned in a human-readable format such as "1 hour",
- * "5 mins", "2 days".
+ * "5 minutes", "2 days".
*
* @since 1.5.0
* @since 5.3.0 Added support for showing a difference in seconds.
@@ -106994,9 +109904,9 @@ function wp_html_excerpt($str, $count, $more = \null)
*
* @global string $_links_add_base
*
- * @param string $content String to search for links in.
- * @param string $base The base URL to prefix to links.
- * @param array $attrs The attributes which should be processed.
+ * @param string $content String to search for links in.
+ * @param string $base The base URL to prefix to links.
+ * @param string[] $attrs The attributes which should be processed.
* @return string The processed content.
*/
function links_add_base_url($content, $base, $attrs = array('src', 'href'))
@@ -107062,11 +109972,11 @@ function normalize_whitespace($str)
{
}
/**
- * Properly strips all HTML tags including script and style
+ * Properly strips all HTML tags including 'script' and 'style'.
*
* This differs from strip_tags() because it removes the contents of
* the `' )`
- * will return 'something'. wp_strip_all_tags will return ''
+ * will return 'something'. wp_strip_all_tags() will return an empty string.
*
* @since 2.9.0
*
@@ -108572,6 +111482,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.
+ * @since 6.7.0 Added support for HEIC images.
*
* @param string $file Full path to the file.
* @return string|false The actual mime type or false if the type cannot be determined.
@@ -109445,20 +112356,6 @@ function wp_ob_end_flush_all()
function dead_db()
{
}
- /**
- * Converts a value to non-negative integer.
- *
- * @since 2.5.0
- *
- * @param mixed $maybeint Data you wish to have converted to a non-negative integer.
- * @return int A non-negative integer.
- * @phpstan-template T of int
- * @phpstan-param T|scalar|array|resource|null $maybeint
- * @phpstan-return ($maybeint is T&int<0, max> ? T : ($maybeint is int ? int<1, max> : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? int<0, max> : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : int<0, max>)))))))
- */
- function absint($maybeint)
- {
- }
/**
* Marks a function as deprecated and inform when it has been used.
*
@@ -110326,8 +113223,10 @@ function wp_validate_boolean($value)
* Deletes a file.
*
* @since 4.2.0
+ * @since 6.7.0 A return value was added.
*
* @param string $file The path to the file to delete.
+ * @return bool True on success, false on failure.
*/
function wp_delete_file($file)
{
@@ -110744,12 +113643,26 @@ function recurse_dirsize($directory, $exclude = \null, $max_execution_time = \nu
function clean_dirsize_cache($path)
{
}
+ /**
+ * Returns the current WordPress version.
+ *
+ * Returns an unmodified value of `$wp_version`. Some plugins modify the global
+ * in an attempt to improve security through obscurity. This practice can cause
+ * errors in WordPress, so the ability to get an unmodified version is needed.
+ *
+ * @since 6.7.0
+ *
+ * @return string The current WordPress version.
+ */
+ function wp_get_wp_version()
+ {
+ }
/**
* Checks compatibility with the current WordPress version.
*
* @since 5.2.0
*
- * @global string $wp_version The WordPress version string.
+ * @global string $_wp_tests_wp_version The WordPress version string. Used only in Core tests.
*
* @param string $required Minimum required WordPress version.
* @return bool True if required version is compatible or empty, false if not.
@@ -110844,6 +113757,17 @@ function wp_get_admin_notice($message, $args = array())
function wp_admin_notice($message, $args = array())
{
}
+ /**
+ * Checks if a mime type is for a HEIC/HEIF image.
+ *
+ * @since 6.7.0
+ *
+ * @param string $mime_type The mime type to check.
+ * @return bool Whether the mime type is for a HEIC/HEIF image.
+ */
+ function wp_is_heic_image_mime_type($mime_type)
+ {
+ }
/**
* Initializes $wp_scripts if it has not been set.
*
@@ -111695,7 +114619,6 @@ function wp_get_document_title()
/**
* Displays title tag with content.
*
- * @ignore
* @since 4.1.0
* @since 4.4.0 Improved title output replaced `wp_title()`.
* @access private
@@ -113067,20 +115990,11 @@ function wp_get_global_styles($path = array(), $context = array())
function wp_get_global_stylesheet($types = array())
{
}
- /**
- * Gets the global styles custom CSS from theme.json.
- *
- * @since 6.2.0
- *
- * @return string The global styles custom CSS.
- */
- function wp_get_global_styles_custom_css()
- {
- }
/**
* Adds global style rules to the inline style for each block.
*
* @since 6.1.0
+ * @since 6.7.0 Resolve relative paths in block styles.
*
* @global WP_Styles $wp_styles
*/
@@ -113195,6 +116109,7 @@ function _wp_http_get_object()
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113238,6 +116153,7 @@ function wp_safe_remote_request($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113281,6 +116197,7 @@ function wp_safe_remote_get($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113324,6 +116241,7 @@ function wp_safe_remote_post($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113364,30 +116282,8 @@ function wp_safe_remote_head($url, $args = array())
* @param string $url URL to retrieve.
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
- * @return array|WP_Error {
- * The response array or a WP_Error on failure.
- *
- * @type string[] $headers Array of response headers keyed by their name.
- * @type string $body Response body.
- * @type array $response {
- * Data about the HTTP response.
- *
- * @type int|false $code HTTP response code.
- * @type string|false $message HTTP response message.
- * }
- * @type WP_HTTP_Cookie[] $cookies Array of response cookies.
- * @type WP_HTTP_Requests_Response|null $http_response Raw HTTP response object.
- * }
- * @phpstan-return \WP_Error|array{
- * headers: string[],
- * body: string,
- * response: array{
- * code: int|false,
- * message: string|false,
- * },
- * cookies: WP_HTTP_Cookie[],
- * http_response: WP_HTTP_Requests_Response|null,
- * }
+ * @return array|WP_Error The response array or a WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113424,6 +116320,7 @@ function wp_remote_request($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113460,6 +116357,7 @@ function wp_remote_get($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113496,6 +116394,7 @@ function wp_remote_post($url, $args = array())
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
* @phpstan-param array{
* method?: string,
* timeout?: float,
@@ -113692,7 +116591,7 @@ function send_origin_headers()
* - ftp://example.com/caniload.php - Invalid protocol - only http and https are allowed.
* - http:///example.com/caniload.php - Malformed URL.
* - http://user:pass@example.com/caniload.php - Login information.
- * - http://exampleeeee.com/caniload.php - Invalid hostname, as the IP cannot be looked up in DNS.
+ * - http://example.invalid/caniload.php - Invalid hostname, as the IP cannot be looked up in DNS.
*
* Examples of URLs that are considered unsafe by default:
*
@@ -113744,12 +116643,8 @@ function ms_allowed_http_request_hosts($is_external, $host)
* A wrapper for PHP's parse_url() function that handles consistency in the return values
* across PHP versions.
*
- * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including
- * schemeless and relative URLs with "://" in the path. This function works around
- * those limitations providing a standard output on PHP 5.2~5.4+.
- *
- * Secondly, across various PHP versions, schemeless URLs containing a ":" in the query
- * are being handled inconsistently. This function works around those differences as well.
+ * Across various PHP versions, schemeless URLs containing a ":" in the query
+ * are being handled inconsistently. This function works around those differences.
*
* @since 4.4.0
* @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`.
@@ -114046,6 +116941,18 @@ function wp_interactivity_data_wp_context(array $context, string $store_namespac
function wp_interactivity_get_context(?string $store_namespace = \null) : array
{
}
+ /**
+ * Returns an array representation of the current element being processed.
+ *
+ * The function should be used only during directive processing.
+ *
+ * @since 6.7.0
+ *
+ * @return array{attributes: array}|null Current element.
+ */
+ function wp_interactivity_get_element() : ?array
+ {
+ }
function get_file($path)
{
}
@@ -115275,6 +118182,7 @@ function load_default_textdomain($locale = \null)
*
* @since 1.5.0
* @since 4.6.0 The function now tries to load the .mo file from the languages directory first.
+ * @since 6.7.0 Translations are no longer immediately loaded, but handed off to the just-in-time loading mechanism.
*
* @param string $domain Unique identifier for retrieving translated strings
* @param string|false $deprecated Optional. Deprecated. Use the $plugin_rel_path parameter instead.
@@ -115291,6 +118199,7 @@ function load_plugin_textdomain($domain, $deprecated = \false, $plugin_rel_path
*
* @since 3.0.0
* @since 4.6.0 The function now tries to load the .mo file from the languages directory first.
+ * @since 6.7.0 Translations are no longer immediately loaded, but handed off to the just-in-time loading mechanism.
*
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
*
@@ -115312,6 +118221,7 @@ function load_muplugin_textdomain($domain, $mu_plugin_rel_path = '')
*
* @since 1.5.0
* @since 4.6.0 The function now tries to load the .mo file from the languages directory first.
+ * @since 6.7.0 Translations are no longer immediately loaded, but handed off to the just-in-time loading mechanism.
*
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
*
@@ -115666,6 +118576,19 @@ function wp_get_list_item_separator()
function wp_get_word_count_type()
{
}
+ /**
+ * Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale.
+ *
+ * @since 6.7.0
+ *
+ * @param string $singular Singular translation to check.
+ * @param string $textdomain Optional. Text domain. Default 'default'.
+ * @param ?string $locale Optional. Locale. Default current locale.
+ * @return bool True if the translation exists, false otherwise.
+ */
+ function has_translation(string $singular, string $textdomain = 'default', ?string $locale = \null) : bool
+ {
+ }
/**
* Displays the permalink for the current post.
*
@@ -116184,11 +119107,15 @@ function get_delete_post_link($post = 0, $deprecated = '', $force_delete = \fals
* Retrieves the edit comment link.
*
* @since 2.3.0
+ * @since 6.7.0 The $context parameter was added.
*
* @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.
- * @return string|void The edit comment link URL for the given comment.
+ * @param string $context Optional. Context in which the URL should be used. Either 'display',
+ * to include HTML entities, or 'url'. Default 'display'.
+ * @return string|void The edit comment link URL for the given comment, or void if the comment id does not exist or
+ * the current user is not allowed to edit it.
*/
- function get_edit_comment_link($comment_id = 0)
+ function get_edit_comment_link($comment_id = 0, $context = 'display')
{
}
/**
@@ -116792,8 +119719,8 @@ function the_posts_navigation($args = array())
* Optional. Default pagination arguments, see paginate_links().
*
* @type string $screen_reader_text Screen reader text for navigation element.
- * Default 'Posts navigation'.
- * @type string $aria_label ARIA label text for the nav element. Default 'Posts'.
+ * Default 'Posts pagination'.
+ * @type string $aria_label ARIA label text for the nav element. Default 'Posts pagination'.
* @type string $class Custom class for the nav element. Default 'pagination'.
* }
* @return string Markup for pagination links.
@@ -116891,14 +119818,16 @@ function get_comments_pagenum_link($pagenum = 1, $max_page = 0)
* Retrieves the link to the next comments page.
*
* @since 2.7.1
+ * @since 6.7.0 Added the `page` parameter.
*
* @global WP_Query $wp_query WordPress Query object.
*
- * @param string $label Optional. Label for link text. Default empty.
- * @param int $max_page Optional. Max page. Default 0.
+ * @param string $label Optional. Label for link text. Default empty.
+ * @param int $max_page Optional. Max page. Default 0.
+ * @param int|null $page Optional. Page number. Default null.
* @return string|void HTML-formatted link for the next page of comments.
*/
- function get_next_comments_link($label = '', $max_page = 0)
+ function get_next_comments_link($label = '', $max_page = 0, $page = \null)
{
}
/**
@@ -116916,11 +119845,13 @@ function next_comments_link($label = '', $max_page = 0)
* Retrieves the link to the previous comments page.
*
* @since 2.7.1
+ * @since 6.7.0 Added the `page` parameter.
*
- * @param string $label Optional. Label for comments link text. Default empty.
+ * @param string $label Optional. Label for comments link text. Default empty.
+ * @param int|null $page Optional. Page number. Default null.
* @return string|void HTML-formatted link for the previous page of comments.
*/
- function get_previous_comments_link($label = '')
+ function get_previous_comments_link($label = '', $page = \null)
{
}
/**
@@ -117027,8 +119958,8 @@ function the_comments_navigation($args = array())
* @param array $args {
* Optional. Default pagination arguments.
*
- * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'.
- * @type string $aria_label ARIA label text for the nav element. Default 'Comments'.
+ * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments pagination'.
+ * @type string $aria_label ARIA label text for the nav element. Default 'Comments pagination'.
* @type string $class Custom class for the nav element. Default 'comments-pagination'.
* }
* @return string Markup for pagination links.
@@ -117470,6 +120401,7 @@ function is_avatar_comment_type($comment_type)
* Retrieves default data about the avatar.
*
* @since 4.2.0
+ * @since 6.7.0 Gravatar URLs always use HTTPS.
*
* @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
* user email, WP_User object, WP_Post object, or WP_Comment object.
@@ -117500,6 +120432,9 @@ function is_avatar_comment_type($comment_type)
* - 'X' (even more mature than above)
* Default is the value of the 'avatar_rating' option.
* @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
+ * For Gravatars this setting is ignored and HTTPS is used to avoid
+ * unnecessary redirects. The setting is retained for systems using
+ * the {@see 'pre_get_avatar_data'} filter to customize avatars.
* Default null.
* @type array $processed_args When the function returns, the value will be the processed/sanitized $args
* plus a "found_avatar" guess. Pass as a reference. Default null.
@@ -117798,8 +120733,6 @@ function wp_is_maintenance_mode()
/**
* Gets the time elapsed so far during this PHP script.
*
- * Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0.
- *
* @since 5.8.0
*
* @return float Seconds since the PHP script started.
@@ -118206,6 +121139,20 @@ function is_user_admin()
function is_multisite()
{
}
+ /**
+ * Converts a value to non-negative integer.
+ *
+ * @since 2.5.0
+ *
+ * @param mixed $maybeint Data you wish to have converted to a non-negative integer.
+ * @return int A non-negative integer.
+ * @phpstan-template T of int
+ * @phpstan-param T|scalar|array|resource|null $maybeint
+ * @phpstan-return ($maybeint is T&int<0, max> ? T : ($maybeint is int ? int<1, max> : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? int<0, max> : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : int<0, max>)))))))
+ */
+ function absint($maybeint)
+ {
+ }
/**
* Retrieves the current site ID.
*
@@ -119129,6 +122076,30 @@ function wp_lazy_loading_enabled($tag_name, $context)
function wp_filter_content_tags($content, $context = \null)
{
}
+ /**
+ * Adds 'auto' to the sizes attribute to the image, if the image is lazy loaded and does not already include it.
+ *
+ * @since 6.7.0
+ *
+ * @param string $image The image tag markup being filtered.
+ * @return string The filtered image tag markup.
+ */
+ function wp_img_tag_add_auto_sizes(string $image) : string
+ {
+ }
+ /**
+ * Checks whether the given 'sizes' attribute includes the 'auto' keyword as the first item in the list.
+ *
+ * Per the HTML spec, if present it must be the first entry.
+ *
+ * @since 6.7.0
+ *
+ * @param string $sizes_attr The 'sizes' attribute value.
+ * @return bool True if the 'auto' keyword is present, false otherwise.
+ */
+ function wp_sizes_attribute_includes_valid_auto(string $sizes_attr) : bool
+ {
+ }
/**
* Adds optimization attributes to an `img` HTML tag.
*
@@ -120056,6 +123027,8 @@ function _wp_add_additional_image_sizes()
* Callback to enable showing of the user error when uploading .heic images.
*
* @since 5.5.0
+ * @since 6.7.0 The default behavior is to enable heic uploads as long as the server
+ * supports the format. The uploads are converted to JPEG's by default.
*
* @param array[] $plupload_settings The settings for Plupload.js.
* @return array[] Modified settings for Plupload.js.
@@ -120202,6 +123175,19 @@ function wp_maybe_add_fetchpriority_high_attr($loading_attrs, $tag_name, $attr)
function wp_high_priority_element_flag($value = \null)
{
}
+ /**
+ * Determines the output format for the image editor.
+ *
+ * @since 6.7.0
+ * @access private
+ *
+ * @param string $filename Path to the image.
+ * @param string $mime_type The source image mime type.
+ * @return string[] An array of mime type mappings.
+ */
+ function wp_get_image_editor_output_format($filename, $mime_type)
+ {
+ }
/**
* Adds metadata for the specified object.
*
@@ -120298,7 +123284,8 @@ function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $d
* The value of the meta field if `$single` is true.
* False for an invalid `$object_id` (non-numeric, zero, or negative value),
* or if `$meta_type` is not specified.
- * An empty string if a valid but non-existing object ID is passed.
+ * An empty array if a valid but non-existing object ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing object ID is passed and `$single` is true.
*/
function get_metadata($meta_type, $object_id, $meta_key = '', $single = \false)
{
@@ -120539,6 +123526,7 @@ function sanitize_meta($meta_key, $meta_value, $object_type, $object_subtype = '
* @since 5.3.0 Valid meta types expanded to include "array" and "object".
* @since 5.5.0 The `$default` argument was added to the arguments array.
* @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array.
+ * @since 6.7.0 The `label` argument was added to the arguments array.
*
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table.
@@ -120550,6 +123538,7 @@ function sanitize_meta($meta_key, $meta_value, $object_type, $object_subtype = '
* the meta key will be registered on the entire object type. Default empty.
* @type string $type The type of data associated with this meta key.
* Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.
+ * @type string $label A human-readable label of the data attached to this meta key.
* @type string $description A description of the data attached to this meta key.
* @type bool $single Whether the meta key has one value per object, or an array of values per object.
* @type mixed $default The default value returned from get_metadata() if no value has been set yet.
@@ -120574,6 +123563,7 @@ function sanitize_meta($meta_key, $meta_value, $object_type, $object_subtype = '
* @phpstan-param array{
* object_subtype?: string,
* type?: string,
+ * label?: string,
* description?: string,
* single?: bool,
* default?: mixed,
@@ -122856,8 +125846,8 @@ function update_sitemeta_cache($site_ids)
*
* @param string|array $args Optional. Array or string of arguments. See WP_Site_Query::__construct()
* for information on accepted arguments. Default empty array.
- * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
- * or the number of sites when 'count' is passed as a query var.
+ * @return WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids',
+ * or the number of sites when 'count' is passed as a query var.
* @phpstan-param array{
* site__in?: int[],
* site__not_in?: int[],
@@ -123124,7 +126114,8 @@ function delete_site_meta($site_id, $meta_key, $meta_value = '')
* @return mixed An array of values if `$single` is false.
* The value of meta data field if `$single` is true.
* False for an invalid `$site_id` (non-numeric, zero, or negative value).
- * An empty string if a valid but non-existing site ID is passed.
+ * An empty array if a valid but non-existing site ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing site ID is passed and `$single` is true.
*/
function get_site_meta($site_id, $key = '', $single = \false)
{
@@ -123871,12 +126862,13 @@ function get_options($options)
* by the plugin which are generally autoloaded can be set to not autoload when the plugin is inactive.
*
* @since 6.4.0
+ * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $options Associative array of option names and their autoload values to set. The option names are
- * expected to not be SQL-escaped. The autoload values accept 'yes'|true to enable or 'no'|false
- * to disable.
+ * expected to not be SQL-escaped. The autoload values should be boolean values. For backward
+ * compatibility 'yes' and 'no' are also accepted, though using these values is deprecated.
* @return array Associative array of all provided $options as keys and boolean values for whether their autoload value
* was updated.
*/
@@ -123890,12 +126882,14 @@ function wp_set_option_autoload_values(array $options)
* each option at once.
*
* @since 6.4.0
+ * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated.
*
* @see wp_set_option_autoload_values()
*
- * @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.
+ * @param string[] $options List of option names. Expected to not be SQL-escaped.
+ * @param bool $autoload Autoload value to control whether to load the options when WordPress starts up.
+ * For backward compatibility 'yes' and 'no' are also accepted, though using these values is
+ * deprecated.
* @return array Associative array of all provided $options as keys and boolean values for whether their autoload value
* was updated.
*/
@@ -123909,12 +126903,14 @@ function wp_set_options_autoload(array $options, $autoload)
* multiple options at once.
*
* @since 6.4.0
+ * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated.
*
* @see wp_set_option_autoload_values()
*
- * @param string $option Name of the option. Expected to not be SQL-escaped.
- * @param string|bool $autoload Autoload value to control whether to load the option when WordPress starts up.
- * Accepts 'yes'|true to enable or 'no'|false to disable.
+ * @param string $option Name of the option. Expected to not be SQL-escaped.
+ * @param bool $autoload Autoload value to control whether to load the option when WordPress starts up.
+ * For backward compatibility 'yes' and 'no' are also accepted, though using these values is
+ * deprecated.
* @return bool True if the autoload value was modified, false otherwise.
*/
function wp_set_option_autoload($option, $autoload)
@@ -124018,17 +127014,19 @@ function wp_load_core_site_options($network_id = \null)
*
* @since 1.0.0
* @since 4.2.0 The `$autoload` parameter was added.
+ * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $option Name of the option to update. Expected to not be SQL-escaped.
* @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
* @param bool|null $autoload Optional. Whether to load the option when WordPress starts up.
- * Accepts a boolean, or `null` to stick with the initial value or, if no initial value is set,
- * to leave the decision up to default heuristics in WordPress.
- * For existing options,
- * `$autoload` can only be updated using `update_option()` if `$value` is also changed.
- * For backward compatibility 'yes' and 'no' are also accepted.
+ * Accepts a boolean, or `null` to stick with the initial value or, if no initial value is
+ * set, to leave the decision up to default heuristics in WordPress.
+ * For existing options, `$autoload` can only be updated using `update_option()` if `$value`
+ * is also changed.
+ * For backward compatibility 'yes' and 'no' are also accepted, though using these values is
+ * deprecated.
* Autoloading too many options can lead to performance problems, especially if the
* options are not frequently used. For options which are accessed across several places
* in the frontend, it is recommended to autoload them, by using true.
@@ -124055,6 +127053,7 @@ function update_option($option, $value, $autoload = \null)
*
* @since 1.0.0
* @since 6.6.0 The $autoload parameter's default value was changed to null.
+ * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
@@ -124063,11 +127062,12 @@ function update_option($option, $value, $autoload = \null)
* Expected to not be SQL-escaped.
* @param string $deprecated Optional. Description. Not used anymore.
* @param bool|null $autoload Optional. Whether to load the option when WordPress starts up.
- * Accepts a boolean, or `null` to leave the decision up to default heuristics in WordPress.
- * For backward compatibility 'yes' and 'no' are also accepted.
+ * Accepts a boolean, or `null` to leave the decision up to default heuristics in
+ * WordPress. For backward compatibility 'yes' and 'no' are also accepted, though using
+ * these values is deprecated.
* Autoloading too many options can lead to performance problems, especially if the
* options are not frequently used. For options which are accessed across several places
- * in the frontend, it is recommended to autoload them, by using 'yes'|true.
+ * in the frontend, it is recommended to autoload them, by using true.
* For options which are accessed only on few specific URLs, it is recommended
* to not autoload them, by using false.
* Default is null, which means WordPress will determine the autoload value.
@@ -125247,10 +128247,10 @@ function wp_hash($data, $scheme = 'auth')
{
}
/**
- * Creates a hash (encrypt) of a plain text password.
+ * Creates a hash of a plain text password.
*
* For integration with other applications, this function can be overwritten to
- * instead use the other package password checking algorithm.
+ * instead use the other package password hashing algorithm.
*
* @since 2.5.0
*
@@ -125263,7 +128263,7 @@ function wp_hash_password($password)
{
}
/**
- * Checks the plaintext password against the encrypted Password.
+ * Checks a plaintext password against a hashed password.
*
* Maintains compatibility between old version and the new cookie authentication
* protocol using PHPass library. The $hash parameter is the encrypted password
@@ -125271,7 +128271,7 @@ function wp_hash_password($password)
* against the already encrypted password to see if they match.
*
* For integration with other applications, this function can be overwritten to
- * instead use the other package password checking algorithm.
+ * instead use the other package password hashing algorithm.
*
* @since 2.5.0
*
@@ -125324,7 +128324,7 @@ function wp_rand($min = \null, $max = \null)
{
}
/**
- * Updates the user's password with a new encrypted one.
+ * Updates the user's password with a new hashed one.
*
* For integration with other applications, this function can be overwritten to
* instead use the other package password checking algorithm.
@@ -127880,7 +130880,7 @@ function _post_type_meta_capabilities($capabilities = \null)
* - `name` - General name for the post type, usually plural. The same and overridden
* by `$post_type_object->label`. Default is 'Posts' / 'Pages'.
* - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'.
- * - `add_new` - Label for adding a new item. Default is 'Add New Post' / 'Add New Page'.
+ * - `add_new` - Label for adding a new item. Default is 'Add New' / 'Add New'.
* - `add_new_item` - Label for adding a new singular item. Default is 'Add New Post' / 'Add New Page'.
* - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'.
* - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'.
@@ -127942,6 +130942,8 @@ function _post_type_meta_capabilities($capabilities = \null)
* @since 6.4.0 Changed default values for the `add_new` label to include the type of content.
* This matches `add_new_item` and provides more context for better accessibility.
* @since 6.6.0 Added the `template_name` label.
+ * @since 6.7.0 Restored pre-6.4.0 defaults for the `add_new` label and updated documentation.
+ * Updated core usage to reference `add_new_item`.
*
* @access private
*
@@ -128302,7 +131304,8 @@ function delete_post_meta($post_id, $meta_key, $meta_value = '')
* @return mixed An array of values if `$single` is false.
* The value of the meta field if `$single` is true.
* False for an invalid `$post_id` (non-numeric, zero, or negative value).
- * An empty string if a valid but non-existing post ID is passed.
+ * An empty array if a valid but non-existing post ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing post ID is passed and `$single` is true.
*/
function get_post_meta($post_id, $key = '', $single = \false)
{
@@ -128357,6 +131360,7 @@ function delete_post_meta_by_key($post_meta_key)
* @phpstan-param array{
* object_subtype?: string,
* type?: string,
+ * label?: string,
* description?: string,
* single?: bool,
* default?: mixed,
@@ -128735,7 +131739,6 @@ function wp_untrash_post_comments($post = \null)
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -128791,7 +131794,6 @@ function wp_get_post_categories($post_id = 0, $args = array())
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -128849,7 +131851,6 @@ function wp_get_post_tags($post_id = 0, $args = array())
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -129997,7 +132998,10 @@ function wp_check_post_hierarchy_for_loops($post_parent, $post_id)
*
* @param int|WP_Post $post Post ID or post object where thumbnail should be attached.
* @param int $thumbnail_id Thumbnail to attach.
- * @return int|bool True on success, false on failure.
+ * @return int|bool Post meta ID if the key didn't exist (ie. this is the first time that
+ * a thumbnail has been saved for the post), true on successful update,
+ * false on failure or if the value passed is the same as the one that
+ * is already in the database.
*/
function set_post_thumbnail($post, $thumbnail_id)
{
@@ -131480,6 +134484,9 @@ function rest_get_avatar_sizes()
/**
* Parses an RFC3339 time into a Unix timestamp.
*
+ * Explicitly check for `false` to detect failure, as zero is a valid return
+ * value on success.
+ *
* @since 4.4.0
*
* @param string $date RFC3339 timestamp.
@@ -132488,7 +135495,7 @@ function _wp_upgrade_revisions_of_post($post, $revisions)
* @param mixed $value Meta value to filter.
* @param int $object_id Object ID.
* @param string $meta_key Meta key to filter a value for.
- * @param bool $single Whether to return a single value. Default false.
+ * @param bool $single Whether to return a single value.
* @return mixed Original meta value if the meta key isn't revisioned, the object doesn't exist,
* the post type is a revision or the post ID doesn't match the object ID.
* Otherwise, the revisioned meta value is returned for the preview.
@@ -132596,7 +135603,7 @@ function remove_permastruct($name)
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*
- * @param string $feedname Feed name.
+ * @param string $feedname Feed name. Should not start with '_'.
* @param callable $callback Callback to run on feed display.
* @return string Feed action name.
*/
@@ -133239,15 +136246,6 @@ function wp_filter_out_block_nodes($nodes)
function wp_enqueue_global_styles()
{
}
- /**
- * Enqueues the global styles custom css defined via theme.json.
- *
- * @since 6.2.0
- * @phpstan-return void
- */
- function wp_enqueue_global_styles_custom_css()
- {
- }
/**
* Checks if the editor scripts and styles for all registered block types
* should be enqueued on the current screen.
@@ -133682,6 +136680,14 @@ function wp_dequeue_script_module(string $id)
function wp_deregister_script_module(string $id)
{
}
+ /**
+ * Registers all the default WordPress Script Modules.
+ *
+ * @since 6.7.0
+ */
+ function wp_default_script_modules()
+ {
+ }
/**
* Adds a new shortcode.
*
@@ -134866,7 +137872,6 @@ function get_term_to_edit($id, $taxonomy)
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -134940,7 +137945,8 @@ function delete_term_meta($term_id, $meta_key, $meta_value = '')
* @return mixed An array of values if `$single` is false.
* The value of the meta field if `$single` is true.
* False for an invalid `$term_id` (non-numeric, zero, or negative value).
- * An empty string if a valid but non-existing term ID is passed.
+ * An empty array if a valid but non-existing term ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing term ID is passed and `$single` is true.
*/
function get_term_meta($term_id, $key = '', $single = \false)
{
@@ -135020,6 +138026,7 @@ function has_term_meta($term_id)
* @phpstan-param array{
* object_subtype?: string,
* type?: string,
+ * label?: string,
* description?: string,
* single?: bool,
* default?: mixed,
@@ -135170,7 +138177,6 @@ function sanitize_term_field($field, $value, $term_id, $taxonomy, $context)
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -135290,7 +138296,6 @@ function wp_delete_category($cat_id)
* number?: int|string,
* offset?: int,
* fields?: string,
- * count?: bool,
* name?: string|string[],
* slug?: string|string[],
* term_taxonomy_id?: int|int[],
@@ -138111,8 +141116,7 @@ function wp_delete_all_temp_backups()
* @access private
*
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
- *
- * @return void|WP_Error Void on success, or a WP_Error object on failure.
+ * @phpstan-return void
*/
function _wp_delete_all_temp_backups()
{
@@ -138364,6 +141368,18 @@ function update_user_option($user_id, $option_name, $newvalue, $is_global = \fal
function delete_user_option($user_id, $option_name, $is_global = \false)
{
}
+ /**
+ * Retrieves user info by user ID.
+ *
+ * @since 6.7.0
+ *
+ * @param int $user_id User ID.
+ *
+ * @return WP_User|false WP_User object on success, false on failure.
+ */
+ function get_user($user_id)
+ {
+ }
/**
* Retrieves list of users matching criteria.
*
@@ -138544,7 +141560,8 @@ function delete_user_meta($user_id, $meta_key, $meta_value = '')
* @return mixed An array of values if `$single` is false.
* The value of meta data field if `$single` is true.
* False for an invalid `$user_id` (non-numeric, zero, or negative value).
- * An empty string if a valid but non-existing user ID is passed.
+ * An empty array if a valid but non-existing user ID is passed and `$single` is false.
+ * An empty string if a valid but non-existing user ID is passed and `$single` is true.
*/
function get_user_meta($user_id, $key = '', $single = \false)
{
@@ -138690,12 +141707,10 @@ function setup_userdata($for_user_id = 0)
/**
* Creates dropdown HTML content of users.
*
- * The content can either be displayed, which it is by default or retrieved by
- * setting the 'echo' argument. The 'include' and 'exclude' arguments do not
- * need to be used; all users will be displayed in that case. Only one can be
- * used, either 'include' or 'exclude', but not both.
- *
- * The available arguments are as follows:
+ * The content can either be displayed, which it is by default, or retrieved by
+ * setting the 'echo' argument to false. The 'include' and 'exclude' arguments
+ * are optional; if they are not specified, all users will be displayed. Only one
+ * can be used in a single call, either 'include' or 'exclude', but not both.
*
* @since 2.3.0
* @since 4.5.0 Added the 'display_name_with_login' value for 'show'.