#28113 closed defect (bug) (worksforme)
class-wp-embed. height always fake in $attr
| Reported by: | alexufo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Embeds | Version: | 3.9 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
1) open class-wp-embed.php at 185 and look for:
$cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
2) add after
_log($attr);
and save file
3) reload any page of your blog with embeded content
( or any post with any youtube link example: http://www.youtube.com/watch?v=s3Mp7FY9oU0 )
4) open debug.log and see $attr array. The height will be always 960. Its never change by any embed url. I think 960 should be like attr height of embed html data.
Change History (7)
#1
follow-up:
↓ 2
@
12 years ago
- Milestone Awaiting Review
- Resolution → worksforme
- Status new → closed
#2
in reply to: ↑ 1
@
12 years ago
Replying to wonderboymusic:
alexufo, thanks for the report, but I can't reproduce your issue. I created an embed with
width="300"and the height dynamically changed to711
Hmm.. trying again i lost my constant 960px. But... no matter.
Do you think how height can be more then width?) How cached height CAN BE 711px at 300px width?!
You can look real height of iframe through firebig.
#3
@
12 years ago
- Resolution worksforme
- Status closed → reopened
- Summary class-wp-embed. height alwase 960 in $attr → class-wp-embed. height alwase fake in $attr
Guys and Girls. Why height always fake and not real of iframe in $attr?
#5
@
12 years ago
- Summary class-wp-embed. height alwase fake in $attr → class-wp-embed. height always fake in $attr
#6
@
12 years ago
- Milestone Awaiting Review
- Resolution → worksforme
- Status reopened → closed
Not all embeds are rendered in landscape orientation. Default is calculated like so:
$height = min( ceil( $width * 1.5 ), 1000 );
Default value for $width is 500, unless $GLOBALS['content_width'] is set.
This is working as expected. If you pass height to your embed shortcode, it will override this default value:
$attr = wp_parse_args( $attr, wp_embed_defaults( $url ) );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
alexufo, thanks for the report, but I can't reproduce your issue. I created an embed with
width="300"and the height dynamically changed to711