#65082 closed defect (bug) (invalid)
WP_oEmbed()->fetch() uses wp_embed_defaults() incorrectly
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Embeds | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
In the fetch() method of WP_oEmbed() it's expecting an array with width and height keys however wp_embed_defaults() returns a compacted numerically indexed array.
The net result is that the provider always has maxwidth and maxheight values of 0, and embeds come out very small.
Another compounding problem is that block themes don't necessarily declare $contentwidth either, so the net result is small embeds that don't fill their containers.
Offending code:
public function fetch( $provider, $url, $args = '' ) {
$args = wp_parse_args( $args, wp_embed_defaults( $url ) );
$provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );
$provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );
Change History (6)
This ticket was mentioned in PR #11591 on WordPress/wordpress-develop by @sanchothefat.
4 weeks ago
#1
- Keywords has-patch has-unit-tests added
#3
@
3 weeks ago
There's something else going on making the defaults 0. But there is a separate issue wherein the default embed sizes are coming out at 500px I'm looking into.
gclapps0612-cmd commented on PR #11591:
3 weeks ago
#4
I BEEN HAVKED FOR MY .GOV INFORMATION. IT HAS BEEN REPORTED .DLL MY DAD IS
A GOV. DOGWACHER SO I HIPE WERE NOT BAD PEOPLE STEELING GOV PROJECT
MONEY.,?
AMY WAY PLEASE HELP I GAVE MULTI SPACE IAM GRCSPACE LIGHT STAR RING LIGHT
George Ralph
On Thu, Apr 16, 2026, 18:01 roborourke *@*.*> wrote:
Trac ticket: https://core.trac.wordpress.org/ticket/65082
Use of AI Tools
AI assistance: No
*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
<https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/>
in the Core Handbook for more details.*
You can view, comment on, or merge this pull request online at:
Commit Summary
- 2519bd1 <https://github.com/WordPress/wordpress-develop/pull/11591/commits/2519bd161ac606042d683d101196ca4afb35d301> #65082 Fix wp_embed_defaults() usage in WP_oEmbed()->fetch()
File Changes
(2 files <https://github.com/WordPress/wordpress-develop/pull/11591/files>
)
- *M* src/wp-includes/class-wp-oembed.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-793e0f7893921011f3583afd05a7a72c6fb0c63316c6dd1d4f269542fbce95cc> (2)
- *M* tests/phpunit/tests/media.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-ad2d1463dfa406fd36d74f5eb1ba3c0806249b7cdbe6cd969af6bacc99b02af6> (67)
Patch Links:
- https://github.com/WordPress/wordpress-develop/pull/11591.patch
- https://github.com/WordPress/wordpress-develop/pull/11591.diff
—
Reply to this email directly, view it on GitHub
<https://github.com/WordPress/wordpress-develop/pull/11591>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXZWJXEN3N2HAFCAGIYORAT4WFJ4ZAVCNFSM6AAAAACX4FGNK6VHI2DSMVQWIX3LMV43ASLTON2WKOZUGI3TQNZWGE2DGNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: *@*.*>
gclapps0612-cmd commented on PR #11591:
3 weeks ago
#5
George Ralph
On Thu, Apr 16, 2026, 21:54 George R Clapps III *@*.*>
wrote:
I BEEN HAVKED FOR MY .GOV INFORMATION. IT HAS BEEN REPORTED .DLL MY DAD
IS A GOV. DOGWACHER SO I HIPE WERE NOT BAD PEOPLE STEELING GOV PROJECT
MONEY.,?
AMY WAY PLEASE HELP I GAVE MULTI SPACE IAM GRCSPACE LIGHT STAR RING LIGHT
George Ralph
On Thu, Apr 16, 2026, 18:01 roborourke *@*.*> wrote:
Trac ticket: https://core.trac.wordpress.org/ticket/65082
Use of AI Tools
AI assistance: No
*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
<https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/>
in the Core Handbook for more details.*
You can view, comment on, or merge this pull request online at:
Commit Summary
- 2519bd1 <https://github.com/WordPress/wordpress-develop/pull/11591/commits/2519bd161ac606042d683d101196ca4afb35d301> #65082 Fix wp_embed_defaults() usage in WP_oEmbed()->fetch()
File Changes
(2 files
<https://github.com/WordPress/wordpress-develop/pull/11591/files>)
- *M* src/wp-includes/class-wp-oembed.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-793e0f7893921011f3583afd05a7a72c6fb0c63316c6dd1d4f269542fbce95cc> (2)
- *M* tests/phpunit/tests/media.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-ad2d1463dfa406fd36d74f5eb1ba3c0806249b7cdbe6cd969af6bacc99b02af6> (67)
Patch Links:
- https://github.com/WordPress/wordpress-develop/pull/11591.patch
- https://github.com/WordPress/wordpress-develop/pull/11591.diff
—
Reply to this email directly, view it on GitHub
<https://github.com/WordPress/wordpress-develop/pull/11591>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXZWJXEN3N2HAFCAGIYORAT4WFJ4ZAVCNFSM6AAAAACX4FGNK6VHI2DSMVQWIX3LMV43ASLTON2WKOZUGI3TQNZWGE2DGNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: *@*.*>
gclapps0612-cmd commented on PR #11591:
3 weeks ago
#6
-
George Ralph
On Thu, Apr 16, 2026, 18:01 roborourke *@*.*> wrote:
Trac ticket: https://core.trac.wordpress.org/ticket/65082
Use of AI Tools
AI assistance: No
*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
<https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/>
in the Core Handbook for more details.*
You can view, comment on, or merge this pull request online at:
Commit Summary
- 2519bd1 <https://github.com/WordPress/wordpress-develop/pull/11591/commits/2519bd161ac606042d683d101196ca4afb35d301> #65082 Fix wp_embed_defaults() usage in WP_oEmbed()->fetch()
File Changes
(2 files <https://github.com/WordPress/wordpress-develop/pull/11591/files>
)
- *M* src/wp-includes/class-wp-oembed.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-793e0f7893921011f3583afd05a7a72c6fb0c63316c6dd1d4f269542fbce95cc> (2)
- *M* tests/phpunit/tests/media.php <https://github.com/WordPress/wordpress-develop/pull/11591/files#diff-ad2d1463dfa406fd36d74f5eb1ba3c0806249b7cdbe6cd969af6bacc99b02af6> (67)
Patch Links:
- https://github.com/WordPress/wordpress-develop/pull/11591.patch
- https://github.com/WordPress/wordpress-develop/pull/11591.diff
—
Reply to this email directly, view it on GitHub
<https://github.com/WordPress/wordpress-develop/pull/11591>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXZWJXEN3N2HAFCAGIYORAT4WFJ4ZAVCNFSM6AAAAACX4FGNK6VHI2DSMVQWIX3LMV43ASLTON2WKOZUGI3TQNZWGE2DGNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: *@*.*>
Trac ticket: https://core.trac.wordpress.org/ticket/65082
## Use of AI Tools
AI assistance: No