From 645714775db285ef48ec53ca3708c78311d5d987 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:44:03 -0700 Subject: [PATCH 1/7] Pass null for the deprecated argument to wp_upload_bits() The `$deprecated` parameter of `wp_upload_bits()` is documented as "Not used. Set to null." `wp_generate_attachment_metadata()` passed an empty string instead when uploading the cover art embedded in audio and video files. The value is ignored either way, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/includes/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 935c613d561e9..c3a4a8d769be0 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -635,7 +635,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { break; } $basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext; - $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] ); + $uploaded = wp_upload_bits( $basename, null, $metadata['image']['data'] ); if ( false === $uploaded['error'] ) { $image_attachment = array( 'post_mime_type' => $metadata['image']['mime'], From 17a77b74292825018fb9f05c9c06175058e44750 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:46:09 -0700 Subject: [PATCH 2/7] Pass an empty string for the deprecated argument to add_option() The `$deprecated` parameter of `add_option()` is documented as a string, defaulting to an empty string. `upgrade_340()` passed null when re-adding the `uninstall_plugins` option without autoloading. `add_option()` only warns when the argument is non-empty, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/includes/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 244401cf24013..833167da3476f 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -1865,7 +1865,7 @@ function upgrade_340() { if ( 'yes' === $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) { $uninstall_plugins = get_option( 'uninstall_plugins' ); delete_option( 'uninstall_plugins' ); - add_option( 'uninstall_plugins', $uninstall_plugins, null, false ); + add_option( 'uninstall_plugins', $uninstall_plugins, '', false ); } } } From 4680ee4abb315f00a5b05daed962c65d61f6282d Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:48:03 -0700 Subject: [PATCH 3/7] Stop passing the unused second argument to iframe_header() The second parameter of `iframe_header()` was renamed to `$deprecated` in WordPress 4.2 and has not been used since. The plugin reactivation screen in `wp-admin/update.php` still passed `true` for it. Dropping the argument changes no behavior. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/update.php b/src/wp-admin/update.php index a6c59ec06dab2..a0ba9cfc069b2 100644 --- a/src/wp-admin/update.php +++ b/src/wp-admin/update.php @@ -87,7 +87,7 @@ wp_redirect( admin_url( 'update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) ); die(); } - iframe_header( __( 'Plugin Reactivation' ), true ); + iframe_header( __( 'Plugin Reactivation' ) ); if ( isset( $_GET['success'] ) ) { echo '

' . __( 'Plugin reactivated successfully.' ) . '

'; } From 8cb638a42fa027376b3ccd63f58029479b8bac0c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:49:01 -0700 Subject: [PATCH 4/7] Pass an empty string for the deprecated argument to wp_install() in tests The `$deprecated` parameter of `wp_install()` is documented as a string, defaulting to an empty string, which is also what `wp-admin/install.php` passes. The PHPUnit install bootstrap passed null instead. `wp_install()` only warns when the argument is non-empty, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- tests/phpunit/includes/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/includes/install.php b/tests/phpunit/includes/install.php index 01b438289b6f5..0f33f668ce782 100644 --- a/tests/phpunit/includes/install.php +++ b/tests/phpunit/includes/install.php @@ -91,7 +91,7 @@ // Prefill a permalink structure so that WP doesn't try to determine one itself. add_action( 'populate_options', '_set_default_permalink_structure_for_tests' ); -wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' ); +wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, '', 'password' ); // Delete dummy permalink structure, as prefilled above. if ( ! is_multisite() ) { From e7347291b8c96b313d666db9be196305116401bd Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 14:02:25 -0700 Subject: [PATCH 5/7] Regenerate baselines --- tests/phpstan/baselines/argument.type.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/phpstan/baselines/argument.type.neon b/tests/phpstan/baselines/argument.type.neon index 9697035667cac..fb8aa57695485 100644 --- a/tests/phpstan/baselines/argument.type.neon +++ b/tests/phpstan/baselines/argument.type.neon @@ -318,11 +318,6 @@ parameters: identifier: argument.type count: 1 path: ../../../src/wp-admin/includes/upgrade.php - - - message: '#^Parameter \#3 \$deprecated of function add_option expects string, null given\.$#' - identifier: argument.type - count: 1 - path: ../../../src/wp-admin/includes/upgrade.php - message: '#^Parameter \#1 \$bookmark_id of function clean_bookmark_cache expects int, string\|null given\.$#' identifier: argument.type From 10464cc41331505dc2429ce58081ecef10c9e0d3 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 1 Oct 2026 08:53:27 +0000 Subject: [PATCH 6/7] Docs: Narrow deprecated parameters to their default values in PHPStan types. Adds `@phpstan-param` tags that narrow unused, deprecated parameters to the literal value of their default (`''`, `null`, `false`, `true`, `array{}` or `'–'`), so that static analysis flags a caller passing anything else. These types come from the function map in php-stubs/wordpress-stubs. `wp_get_typography_font_size_value()` also narrows `$settings` to `array`, since its boolean form was deprecated in 6.6.0. Three entries from the map are left out because core uses the parameter: `redirect_this_site()` is hooked to `allowed_redirect_hosts` and receives an array, `WP_Widget::update_callback()` is registered with `array( 'number' => -1 )`, and `wp_count_terms()` still accepts the legacy argument form through `$deprecated`. This builds on the call-site fixes that pass the documented values to `wp_upload_bits()`, `add_option()`, `iframe_header()` and `wp_install()`. See #65817. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VieGtSQtUoVfHiGwTmkvtc --- src/wp-admin/includes/meta-boxes.php | 2 ++ src/wp-admin/includes/plugin-install.php | 2 ++ src/wp-admin/includes/plugin.php | 1 + src/wp-admin/includes/template.php | 2 ++ src/wp-admin/includes/upgrade.php | 2 ++ src/wp-includes/author-template.php | 7 +++++++ src/wp-includes/block-patterns.php | 2 ++ src/wp-includes/block-supports/typography.php | 2 ++ src/wp-includes/block-template-utils.php | 2 ++ src/wp-includes/category-template.php | 2 ++ src/wp-includes/class-wp-object-cache.php | 2 ++ src/wp-includes/class-wp-theme-json-resolver.php | 2 ++ src/wp-includes/comment-template.php | 5 +++++ src/wp-includes/comment.php | 2 ++ src/wp-includes/feed.php | 4 ++++ src/wp-includes/formatting.php | 4 ++++ src/wp-includes/functions.php | 4 ++++ src/wp-includes/kses.php | 2 ++ src/wp-includes/l10n.php | 2 ++ src/wp-includes/link-template.php | 2 ++ src/wp-includes/meta.php | 2 ++ src/wp-includes/ms-blogs.php | 6 ++++++ src/wp-includes/ms-functions.php | 4 ++++ src/wp-includes/option.php | 4 ++++ src/wp-includes/post-template.php | 2 ++ src/wp-includes/revision.php | 2 ++ src/wp-includes/user.php | 2 ++ src/wp-includes/widgets.php | 2 ++ 28 files changed, 77 insertions(+) diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php index 535a00cd3fe94..9149f50daadd8 100644 --- a/src/wp-admin/includes/meta-boxes.php +++ b/src/wp-admin/includes/meta-boxes.php @@ -1257,6 +1257,8 @@ function link_target_meta_box( $link ) { * if it matches the current link's relationship. * Default empty string. * @param mixed $deprecated Deprecated. Not used. + * + * @phpstan-param '' $deprecated */ function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) { global $link; diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php index b37b956d3455c..ffae71c5b81f6 100644 --- a/src/wp-admin/includes/plugin-install.php +++ b/src/wp-admin/includes/plugin-install.php @@ -309,6 +309,8 @@ function install_dashboard() { * @since 4.6.0 The `$type_selector` parameter was deprecated. * * @param bool $deprecated Not used. + * + * @phpstan-param true $deprecated */ function install_search_form( $deprecated = true ) { $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index a34d473bca650..39b6295f774bb 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -907,6 +907,7 @@ function activate_plugins( $plugins, $redirect = '', $network_wide = false, $sil * @return bool|null|WP_Error True on success, false if `$plugins` is empty, `WP_Error` on failure. * `null` if filesystem credentials are required to proceed. * + * @phpstan-param '' $deprecated * @phpstan-return ( $plugins is empty ? false : true|null|WP_Error ) */ function delete_plugins( $plugins, $deprecated = '' ) { diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 93428dcc4ae6d..e8f6c4f5bab6c 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -2143,6 +2143,8 @@ function _admin_search_query() { * * @param string $title Optional. Title of the Iframe page. Default empty. * @param bool $deprecated Not used. + * + * @phpstan-param false $deprecated */ function iframe_header( $title = '', $deprecated = false ) { global $hook_suffix, $admin_body_class, $body_id, $wp_locale; diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 833167da3476f..461ab78a219e5 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -43,6 +43,8 @@ * @type string $password The password of the site owner, if their user account didn't already exist. * @type string $password_message The explanatory message regarding the password. * } + * + * @phpstan-param '' $deprecated */ function wp_install( $blog_title, diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php index 342132feadd85..204f69cac580a 100644 --- a/src/wp-includes/author-template.php +++ b/src/wp-includes/author-template.php @@ -20,6 +20,8 @@ * * @param string $deprecated Deprecated. * @return string The author's display name, empty string if unknown. + * + * @phpstan-param '' $deprecated */ function get_the_author( $deprecated = '' ) { global $authordata; @@ -57,6 +59,9 @@ function get_the_author( $deprecated = '' ) { * @param string $deprecated Deprecated. * @param bool $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it. * @return string The author's display name, from get_the_author(). + * + * @phpstan-param '' $deprecated + * @phpstan-param true $deprecated_echo */ function the_author( $deprecated = '', $deprecated_echo = true ) { if ( ! empty( $deprecated ) ) { @@ -362,6 +367,8 @@ function get_the_author_posts_link() { * @since 4.4.0 Converted into a wrapper for get_the_author_posts_link() * * @param string $deprecated Unused. + * + * @phpstan-param '' $deprecated */ function the_author_posts_link( $deprecated = '' ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/block-patterns.php b/src/wp-includes/block-patterns.php index 50ca1a426378d..3e50b349d242c 100644 --- a/src/wp-includes/block-patterns.php +++ b/src/wp-includes/block-patterns.php @@ -277,6 +277,8 @@ function wp_normalize_remote_block_pattern( $pattern ) { * @since 6.3.0 Add 'pattern-directory/core' to the pattern's 'source'. * * @param WP_Screen $deprecated Unused. Formerly the screen that the current request was triggered from. + * + * @phpstan-param null $deprecated */ function _load_remote_block_patterns( $deprecated = null ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/block-supports/typography.php b/src/wp-includes/block-supports/typography.php index 8e80d0e60bf9d..9ecc1b6edd5a2 100644 --- a/src/wp-includes/block-supports/typography.php +++ b/src/wp-includes/block-supports/typography.php @@ -560,6 +560,8 @@ function wp_get_computed_fluid_typography_value( $args = array() ) { * @param bool|array $settings Optional Theme JSON settings array that overrides any global theme settings. * Default is false. * @return string|null Font-size value or null if a size is not passed in $preset. + * + * @phpstan-param array $settings */ function wp_get_typography_font_size_value( $preset, $settings = array() ) { if ( ! isset( $preset['size'] ) ) { diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index 78cd1bbdc15f5..9c6be11c7dfc4 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -1711,6 +1711,8 @@ function get_template_hierarchy( $slug, $is_custom = false, $template_prefix = ' * prepared for inserting or updating the database. * @param WP_REST_Request $deprecated Deprecated. Not used. * @return stdClass|WP_Error The updated object representing a template or template part. + * + * @phpstan-param null $deprecated */ function inject_ignored_hooked_blocks_metadata_attributes( $changes, $deprecated = null ) { if ( null !== $deprecated ) { diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 1d456f309de3d..b4c40d2ac971f 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -43,6 +43,8 @@ function get_category_link( $category ) { * @param bool $nicename Optional. Whether to use nice name for display. Default false. * @param array $deprecated Not used. * @return string|WP_Error A list of category parents on success, WP_Error on failure. + * + * @phpstan-param array{} $deprecated */ function get_category_parents( $category_id, $link = false, $separator = '/', $nicename = false, $deprecated = array() ) { diff --git a/src/wp-includes/class-wp-object-cache.php b/src/wp-includes/class-wp-object-cache.php index cda63e66d49ef..d79246ad2e3b0 100644 --- a/src/wp-includes/class-wp-object-cache.php +++ b/src/wp-includes/class-wp-object-cache.php @@ -420,6 +420,8 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $deprecated Optional. Unused. Default false. * @return bool True on success, false if the contents were not deleted. + * + * @phpstan-param false $deprecated */ public function delete( $key, $group = 'default', $deprecated = false ) { if ( ! $this->is_valid_key( $key ) ) { diff --git a/src/wp-includes/class-wp-theme-json-resolver.php b/src/wp-includes/class-wp-theme-json-resolver.php index dc236f87907bb..05eedbcd40397 100644 --- a/src/wp-includes/class-wp-theme-json-resolver.php +++ b/src/wp-includes/class-wp-theme-json-resolver.php @@ -240,6 +240,8 @@ protected static function has_same_registered_blocks( $origin ) { * @type bool $with_supports Whether to include theme supports in the data. Default true. * } * @return WP_Theme_JSON Entity that holds theme data. + * + * @phpstan-param array{} $deprecated */ public static function get_theme_data( $deprecated = array(), $options = array() ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index f7068362174e2..cc2608d4220e1 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -893,6 +893,9 @@ function get_comments_link( $post = 0 ) { * * @param string $deprecated Not Used. * @param string $deprecated_2 Not Used. + * + * @phpstan-param '' $deprecated + * @phpstan-param '' $deprecated_2 */ function comments_link( $deprecated = '', $deprecated_2 = '' ) { if ( ! empty( $deprecated ) ) { @@ -1279,6 +1282,8 @@ function trackback_url( $deprecated_echo = true ) { * @since 0.71 * * @param int|string $deprecated Not used (Was $timezone = 0). + * + * @phpstan-param '' $deprecated */ function trackback_rdf( $deprecated = '' ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 9ad18180b78e9..9111358efc40b 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -3204,6 +3204,8 @@ function wp_update_comment_count_now( $post_id ) { * @param string $url URL to ping. * @param string $deprecated Not Used. * @return string|false String containing URI on success, false on failure. + * + * @phpstan-param '' $deprecated */ function discover_pingback_server_uri( $url, $deprecated = '' ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php index 7f9988b29f246..7f9b977656aa6 100644 --- a/src/wp-includes/feed.php +++ b/src/wp-includes/feed.php @@ -99,6 +99,8 @@ function get_default_feed() { * * @param string $deprecated Unused. * @return string The document title. + * + * @phpstan-param '–' $deprecated */ function get_wp_title_rss( $deprecated = '–' ) { if ( '–' !== $deprecated ) { @@ -125,6 +127,8 @@ function get_wp_title_rss( $deprecated = '–' ) { * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`. * * @param string $deprecated Unused. + * + * @phpstan-param '–' $deprecated */ function wp_title_rss( $deprecated = '–' ) { if ( '–' !== $deprecated ) { diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index c39beaf7b1d68..6cb0ab08a7ff3 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2520,6 +2520,8 @@ function sanitize_locale_name( $locale_name ) { * @param string $content String of characters to be converted. * @param string $deprecated Not used. * @return string Converted string. + * + * @phpstan-param '' $deprecated */ function convert_chars( $content, $deprecated = '' ) { if ( ! empty( $deprecated ) ) { @@ -3651,6 +3653,8 @@ function convert_smilies( $text ) { * @param string $email Email address to verify. * @param bool $deprecated Deprecated. * @return string|false Valid email address on success, false on failure. + * + * @phpstan-param false $deprecated */ function is_email( $email, $deprecated = false ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 393f50a3aad58..72e7944b7bb5e 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -1005,6 +1005,8 @@ function do_enclose( $content, $post ) { * @param string $url URL to retrieve HTTP headers from. * @param bool $deprecated Not Used. * @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary|false Headers on success, false on failure. + * + * @phpstan-param false $deprecated */ function wp_get_http_headers( $url, $deprecated = false ) { if ( ! empty( $deprecated ) ) { @@ -2955,6 +2957,8 @@ function _wp_check_existing_file_names( $filename, $files ) { * } * @phpstan-return array{ file: non-empty-string, url: non-empty-string, type: string|false, error: false } * |array{ error: string, ... } + * + * @phpstan-param null $deprecated */ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index ea7db4f9c4eb8..509806bc599a7 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -2629,6 +2629,8 @@ function kses_init() { * @param string $css A string of CSS rules, decoded from an HTML `style` attribute. * @param string $deprecated Not used. * @return string Filtered string of CSS rules, needing HTML escaping before sending back to a `style` attribute. + * + * @phpstan-param '' $deprecated */ function safecss_filter_attr( $css, $deprecated = '' ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php index 7b9d2652d41dd..96fb4cc9a166b 100644 --- a/src/wp-includes/l10n.php +++ b/src/wp-includes/l10n.php @@ -995,6 +995,8 @@ function load_default_textdomain( $locale = null ) { * @param string|false $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR where the .mo file resides. * Default false. * @return bool True when textdomain is successfully loaded, false otherwise. + * + * @phpstan-param false $deprecated */ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path = false ) { /** @var WP_Textdomain_Registry $wp_textdomain_registry */ diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 3d4ffc23b8f62..671e510be3bb8 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -1560,6 +1560,8 @@ function edit_post_link( $text = null, $before = '', $after = '', $post = 0, $cs * @param string $deprecated Not used. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. Default false. * @return string|null The delete post link URL for the given post. + * + * @phpstan-param '' $deprecated */ function get_delete_post_link( $post = 0, $deprecated = '', $force_delete = false ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 6adcf389d5884..765ce96e58a9f 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -1490,6 +1490,8 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * @return bool True if the meta key was successfully registered in the global array, false if not. * Registering a meta key with distinct sanitize and auth callbacks will fire those callbacks, * but will not add to the global registry. + * + * @phpstan-param null $deprecated */ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { global $wp_meta_keys; diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index c54563fbbd2b8..2ac766ffc37ad 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/wp-includes/ms-blogs.php @@ -456,6 +456,8 @@ function delete_blog_option( $id, $option ) { * @param mixed $value The option value. * @param mixed $deprecated Not used. * @return bool True if the value was updated, false otherwise. + * + * @phpstan-param null $deprecated */ function update_blog_option( $id, $option, $value, $deprecated = null ) { $id = (int) $id; @@ -496,6 +498,8 @@ function update_blog_option( $id, $option, $value, $deprecated = null ) { * @param int $new_blog_id The ID of the blog to switch to. Default: current blog. * @param bool $deprecated Not used. * @return true Always returns true. + * + * @phpstan-param null $deprecated */ function switch_to_blog( $new_blog_id, $deprecated = null ) { global $wpdb; @@ -819,6 +823,8 @@ function get_blog_status( $id, $pref ) { * Can be used for pagination. Default 0. * @param int $quantity Optional. The maximum number of blogs to retrieve. Default 40. * @return array The list of blogs. + * + * @phpstan-param '' $deprecated */ function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) { global $wpdb; diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 81dda98f3e312..b5097bca8ae0d 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -1478,6 +1478,8 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $options = array(), * @param WP_Site|int $blog_id The new site's object or ID. * @param string $deprecated Not used. * @return bool + * + * @phpstan-param '' $deprecated */ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { if ( is_object( $blog_id ) ) { @@ -2088,6 +2090,8 @@ function check_upload_mimes( $mimes ) { * @global wpdb $wpdb WordPress database abstraction object. * * @param string $deprecated Not used. + * + * @phpstan-param '' $deprecated */ function update_posts_count( $deprecated = '' ) { global $wpdb; diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index d5c179c645af3..49ecfb65977f4 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -1065,6 +1065,8 @@ function update_option( $option, $value, $autoload = null ) { * to not autoload them, by using false. * Default is null, which means WordPress will determine the autoload value. * @return bool True if the option was added, false otherwise. + * + * @phpstan-param '' $deprecated */ function add_option( $option, $value = '', $deprecated = '', $autoload = null ) { global $wpdb; @@ -1930,6 +1932,8 @@ function delete_all_user_settings() { * @param mixed $default_value Optional. Value to return if the option doesn't exist. Default false. * @param bool $deprecated Whether to use cache. Multisite only. Always set to true. * @return mixed Value set for the option. + * + * @phpstan-param true $deprecated */ function get_site_option( $option, $default_value = false, $deprecated = true ) { return get_network_option( null, $option, $default_value ); diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index b817653aaf0ec..8a571495e96ca 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1640,6 +1640,8 @@ function walk_page_dropdown_tree( ...$args ) { * @param bool $fullsize Optional. Whether to use full size. Default false. * @param bool $deprecated Deprecated. Not used. * @param bool $permalink Optional. Whether to include permalink. Default false. + * + * @phpstan-param false $deprecated */ function the_attachment_link( $post = 0, $fullsize = false, $deprecated = false, $permalink = false ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/revision.php b/src/wp-includes/revision.php index 31bbceeb4ec9c..179a32c2832c5 100644 --- a/src/wp-includes/revision.php +++ b/src/wp-includes/revision.php @@ -18,6 +18,8 @@ * for insertion as a post revision. Default empty array. * @param bool $deprecated Not used. * @return string[] Array of fields that can be versioned. + * + * @phpstan-param false $deprecated */ function _wp_post_revision_fields( $post = array(), $deprecated = false ) { static $fields = null; diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 92d091165525b..352dcf357b76a 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -749,6 +749,8 @@ function get_current_user_id() { * @param int $user Optional. User ID. * @param string $deprecated Use get_option() to check for an option in the options table. * @return mixed User option value on success, false on failure. + * + * @phpstan-param '' $deprecated */ function get_user_option( $option, $user = 0, $deprecated = '' ) { global $wpdb; diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php index 5e679f4b92ca9..d40a39ced04c1 100644 --- a/src/wp-includes/widgets.php +++ b/src/wp-includes/widgets.php @@ -1018,6 +1018,8 @@ function is_active_sidebar( $index ) { * * @param bool $deprecated Not used (argument deprecated). * @return array Upgraded list of widgets to version 3 array format when called from the admin. + * + * @phpstan-param true $deprecated */ function wp_get_sidebars_widgets( $deprecated = true ) { if ( true !== $deprecated ) { From 65c01d41ceec07ade7efeaeff2a7dca2e280a0dd Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 5 Oct 2026 13:46:36 +0000 Subject: [PATCH 7/7] Docs: Address review feedback on deprecated parameter types. Stop passing the deprecated $check_domain argument from validate_email() to is_email(), update the $settings description of wp_get_typography_font_size_value(), and place @phpstan-param before @phpstan-return in wp_upload_bits(). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015BuoHZQvJMvPEYp4Sfjgvd --- src/wp-includes/block-supports/typography.php | 4 ++-- src/wp-includes/functions.php | 4 ++-- src/wp-includes/ms-deprecated.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/block-supports/typography.php b/src/wp-includes/block-supports/typography.php index b46e9ec3d4153..6204ed02b6f86 100644 --- a/src/wp-includes/block-supports/typography.php +++ b/src/wp-includes/block-supports/typography.php @@ -573,8 +573,8 @@ function wp_get_computed_fluid_typography_value( $args = array() ) { * @type string $slug Kebab-case, unique identifier for the font size preset. * @type string|int|float $size CSS font-size value, including units if applicable. * } - * @param bool|array $settings Optional Theme JSON settings array that overrides any global theme settings. - * Default is false. + * @param bool|array $settings Optional. Theme JSON settings array that overrides any global theme settings. + * Passing a boolean is deprecated. Default empty array. * @return string|null Font-size value or null if a size is not passed in $preset. * * @phpstan-param array $settings diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 72e7944b7bb5e..e9754dc108571 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -2955,10 +2955,10 @@ function _wp_check_existing_file_names( $filename, $files ) { * Not set if there has been an error. * @type string|false $error Error message, if there has been an error. * } - * @phpstan-return array{ file: non-empty-string, url: non-empty-string, type: string|false, error: false } - * |array{ error: string, ... } * * @phpstan-param null $deprecated + * @phpstan-return array{ file: non-empty-string, url: non-empty-string, type: string|false, error: false } + * |array{ error: string, ... } */ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { if ( ! empty( $deprecated ) ) { diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php index c1de27db4cb4c..8b4a1ff6f023f 100644 --- a/src/wp-includes/ms-deprecated.php +++ b/src/wp-includes/ms-deprecated.php @@ -171,7 +171,7 @@ function is_main_blog() { */ function validate_email( $email, $check_domain = true) { _deprecated_function( __FUNCTION__, '3.0.0', 'is_email()' ); - return is_email( $email, $check_domain ); + return is_email( $email ); } /**