Repository navigation
Pass the documented values for deprecated arguments - #13872
westonruter wants to merge 5 commits into
Conversation
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…ests 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 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
🤖 Comment by Claude Opus 5.5 Props gathered for this subset from the full history of
All were authored by @IanDelMar (marian1). The goal of php-stubs/wordpress-stubs#436 was to narrow deprecated parameters to their default values "so PHPStan can flag when developers pass non-default arguments", which is exactly what surfaced these four calls. Neither stubs PR carries co-authors or reviews. The other contributors credited on #13530 and #13614 did not author these entries, so they are left to the subsets that carry theirs. Props for this PR: cc @IanDelMar |
Four core calls passed a value to a deprecated parameter that did not match its documented type. None of these values are used, so there is no change in behavior. These call sites were surfaced by narrowing the types of deprecated parameters in the PHPStan stubs. Fixing them first allows the corresponding PHPStan types to be added to core as docblock-only changes. The now-obsolete `add_option()` entry is removed from the PHPStan baseline. Developed in #13872. Follow-up to r20080, r23766, r31443, r63024. Props marian1, swissspidy, westonruter. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@64045 602fd350-edb4-49c9-b593-d223f7449a82
Four core calls passed a value to a deprecated parameter that did not match its documented type. None of these values are used, so there is no change in behavior. These call sites were surfaced by narrowing the types of deprecated parameters in the PHPStan stubs. Fixing them first allows the corresponding PHPStan types to be added to core as docblock-only changes. The now-obsolete `add_option()` entry is removed from the PHPStan baseline. Developed in WordPress/wordpress-develop#13872. Follow-up to r20080, r23766, r31443, r63024. Props marian1, swissspidy, westonruter. See #65817. Built from https://develop.svn.wordpress.org/trunk@64045 git-svn-id: http://core.svn.wordpress.org/trunk@63204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
✅ Committed in r64045 (441b562).
Splits the call-site fixes out of #13530, so that the PHPStan types it adds can land as docblock-only changes.
Four core calls pass a value to a deprecated parameter that doesn't match its documented type. None of these values are used, so none of the fixes change behavior:
wp_generate_attachment_metadata()passes''towp_upload_bits(), whose$deprecatedis documented as "Not used. Set to null." It now passesnull.upgrade_340()passesnulltoadd_option(), whose$deprecatedis a string defaulting to''. It now passes''.wp-admin/update.phppassestruetoiframe_header(), whose second parameter has been unused since 4.2. The argument is dropped.nulltowp_install(), whose$deprecatedis a string defaulting to'', which is whatwp-admin/install.phppasses. It now passes''.The first three come from #13530. The fourth was found while reviewing that PR: its
@phpstan-param '' $deprecatedonwp_install()would flag the bootstrap call.#13530 also adds a
@phpstan-ignore arguments.counttoWP_Widget_Factory::register(). That is left out here, since the error only exists once that PR types$widgetasclass-string<WP_Widget>. On trunk nothing is reported, so the ignore belongs with that change.Each fix is its own commit.
Trac ticket: https://core.trac.wordpress.org/ticket/65817
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Identifying the call sites while reviewing #13530, making the changes, and drafting the commit messages and this description. Reviewed by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
🤖 Generated with Claude Code