Repository navigation
Fix solution for empty.offset error in wp_read_video_metadata() - #15303
westonruter wants to merge 2 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
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. |
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the video-metadata simplification and pointer-documentation cleanup.
No open issues 🎉
What changed in this PR
This follow-up to #14027 simplifies the empty.offset fix in video metadata handling and consolidates internal-pointer type documentation.
Changes:
- Removes the redundant timestamp guard and broad
$metadatatype annotation fromwp_read_video_metadata(). - Moves pointer array type annotations into existing comments, converting them to docblocks without changing runtime behavior.
| File | Description |
|---|---|
src/wp-admin/includes/media.php |
Simplifies creation-timestamp assignment and removes the metadata type annotation. |
src/wp-admin/includes/class-wp-internal-pointers.php |
Consolidates array type annotations into descriptive docblocks. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Agreed with this correction. created_timestamp cannot be populated before the removed condition, so removing that condition preserves behavior and lets PHPStan infer the metadata shape. The strict false check remains, and both pointer annotations retain their original types.
Full PHPStan passed. The existing media-metadata checks passed before and after the patch in randomized single-site and multisite runs: nine tests and nine assertions per run. Syntax checks passed; full-file PHPCS reports only the same three pre-existing warnings. Copilot found no active issue. No additional tests are needed for this behavior-equivalent simplification.
Approved on code and local validation; CI is still running before landing.
AI review · gpt-6
Remove the broad `$metadata` annotation and the always-true `created_timestamp` guard in `wp_read_video_metadata()`. Preserve the timestamp helper call and strict `false` check. Combine the pointer array type annotations with their explanatory docblocks. Follow-up to [65149]. Developed in: #15303 Props westonruter. See #65817. git-svn-id: https://develop.svn.wordpress.org/trunk@65158 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15303 landed in https://core.trac.wordpress.org/changeset/65158 |
Remove the broad `$metadata` annotation and the always-true `created_timestamp` guard in `wp_read_video_metadata()`. Preserve the timestamp helper call and strict `false` check. Combine the pointer array type annotations with their explanatory docblocks. Follow-up to [65149]. Developed in: WordPress/wordpress-develop#15303 Props westonruter. See #65817. Built from https://develop.svn.wordpress.org/trunk@65158 git-svn-id: http://core.svn.wordpress.org/trunk@64307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a follow-up to feedback on #14027:
Trac ticket: https://core.trac.wordpress.org/ticket/65817
Use of AI Tools
AI assistance: None 🧠
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.