#28113 closed defect (bug) (worksforme)
class-wp-embed. height always fake in $attr
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9 |
Component: | Embeds | Keywords: | |
Focuses: | Cc: |
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
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
#2
in reply to:
↑ 1
@
11 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
@
11 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
- Summary changed from class-wp-embed. height alwase 960 in $attr to class-wp-embed. height alwase fake in $attr
Guys and Girls. Why height always fake and not real of iframe in $attr?
#5
@
11 years ago
- Summary changed from class-wp-embed. height alwase fake in $attr to class-wp-embed. height always fake in $attr
#6
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from reopened to 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 ) );
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