Skip to content

Dailymotion Shortcode: small changes to #4103#1

Merged
MathildeS merged 5 commits intoMathildeS:update/dailymotion-shortcodefrom
jeherve:update/dailymotion-shortcode
Jul 20, 2016
Merged

Dailymotion Shortcode: small changes to #4103#1
MathildeS merged 5 commits intoMathildeS:update/dailymotion-shortcodefrom
jeherve:update/dailymotion-shortcode

Conversation

@jeherve
Copy link
Copy Markdown

@jeherve jeherve commented Jul 13, 2016

There are a few things that I can think could be changed in the PR you submitted here:
Automattic#4103

I think the changes attached to this PR could help.

Let me know if you like them, and if you do, you can merge this PR and all commits will be automatically included in the original PR.

jeherve added 5 commits July 13, 2016 16:05
Width and height values should always be full, positive numbers.
It allows third-parties to filter the available shortcode parameters later on.
- add_query_arg builds a cleaner URL, with all necessary appended query variables.
- add more checks before a variable is used.
- When we have that value and no width value was defined, it should be the priority.
if ( ! $width && ! $height ) {
if ( ! empty( $content_width ) ) {
$width = min( 425, intval( $content_width ) );
$width = absint( $content_width );
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, I just have a comment here, the old code used to have $width = min( 425, intval( $content_width ) );, this is why I left if, for compatibility reasons. I'm not against using the value when set, but aren't we risking to break the existing usages of this shortcode if we change this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will change things a bit, yes, but I think it's best if $content_width takes priority when it's provided by the theme and when no width is provided in the shortcode.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright! I can merge the PR then

@MathildeS
Copy link
Copy Markdown
Owner

I just have a comment on one line (about width value), otherwise it's all good for me. When we've clarified this thing about width value, I'll happily merge the PR.

@jeherve
Copy link
Copy Markdown
Author

jeherve commented Jul 19, 2016

I replied to your comment here: #1 (comment)

@MathildeS MathildeS merged commit 329ac79 into MathildeS:update/dailymotion-shortcode Jul 20, 2016
MathildeS pushed a commit that referenced this pull request Jul 26, 2016
After The Deadline: add spaces for WP coding standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants