Automattic / Automattic/jetpack

Kickstarter: embed width is limited by content_width, but embed height is still calculated from width parameter

Open
#6,094 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Shortcodes / Embeds [Pri] Low Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Add the following to a site with Jetpack and the Shortcodes module active:
`[kickstarter url="https://www.kickstarter.com/projects/laleiden/new-album-los-muertos-tambien-dejan-flores?ref=home_potd" width="3000"]`
2. The embed's width won't be 3000px, since the theme's `$content_width` value will stop that from happening. However, the embed's height is still calculated based on that width parameter:

![screen shot 2017-01-13 at 12 49 28](https://cloud.githubusercontent.com/assets/426388/21929064/bff36eb0-d98e-11e6-9e38-4ba32cc17af6.png)

3. Maybe we could do something like for YouTube, where we calculate the height based on the width?
https://github.com/Automattic/jetpack/blob/master/modules/shortcodes/youtube.php#L175

Contributor guide

Open the contributing guide

Research direction

Start at the Kickstarter shortcode entry point in the Shortcodes module and compare its sizing logic with modules/shortcodes/youtube.php, the referenced example. Reproduce the supplied shortcode with a theme content width, then verify that the rendered width—not the requested width—controls the embed height.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.