Opened 9 years ago
Closed 9 years ago
#41299 closed defect (bug) (fixed)
oEmbed proxy fails to forward maxwidth and maxheight params
| Reported by: | westonruter | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.8.1 |
| Component: | Embeds | Version: | 4.8 |
| Severity: | normal | Keywords: | has-patch has-unit-tests commit fixed-major |
| Cc: | Focuses: | rest-api |
Description
oEmbed uses the maxwidth and maxheight params, and the oEmbed proxy endpoint added in core as of #40450 uses the same. However, it turns out that that WP_oEmbed::fetch() uses width and height instead. So currently passing these maxwidth and maxheight params have no effect. This is causing a problem in Gutenberg where the oEmbed needs to be written into a sandbox iframe that has specific dimensions: https://github.com/WordPress/gutenberg/pull/1688#issuecomment-314862861
Attachments (2)
Change History (15)
This ticket was mentioned in Slack in #core by westonruter. View the logs.
9 years ago
#4
@
9 years ago
Shouldn't the unset( $args['_wpnonce'] ); part be handled by #41048? Or do you want to close that one as a duplicate?
#5
@
9 years ago
@swissspidy Yes, it can be committed as part of #41048. I wasn't aware of that other ticket when I was making this patch, so I was just going to sneak it in.
#6
@
9 years ago
- Keywords commit added
@swissspidy does 41299.1.diff look good to you?
Build passes: https://travis-ci.org/xwp/wordpress-develop/builds/253005279
#8
follow-up:
↓ 10
@
9 years ago
Sorry, I just saw that you pinged me for review here. Code looks good and fixes the related Gutenberg issue mentioned in the OP. I tested as follows:
- Added the
?maxwidth=parameter in the Gutenberg code - Loaded various embeds with and without this patch
- Before loading each embed, clear the cached results by running
foreach ( $wpdb->get_results("SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_transient%oembed%'") as $row ) { error_log( $row->option_name ); delete_option( $row->option_name ); }inwp shell
+1 for commit.
#10
in reply to: ↑ 8
@
9 years ago
Replying to jnylen0:
- Before loading each embed, clear the cached results by running
foreach ( $wpdb->get_results("SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_transient%oembed%'") as $row ) { error_log( $row->option_name ); delete_option( $row->option_name ); }inwp shell
BTW, you can also use wp transient delete --all.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
https://github.com/xwp/wordpress-develop/pull/239