[wp-trac] [WordPress Trac] #40590: wp_video_shortcode always adds controls="controls"
WordPress Trac
noreply at wordpress.org
Thu May 4 14:07:21 UTC 2017
#40590: wp_video_shortcode always adds controls="controls"
-----------------------------------+------------------------------
Reporter: paulschreiber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.7.4
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses:
-----------------------------------+------------------------------
Comment (by subrataemfluence):
Thank you for modifying the patch. However, it is still adding
`controls="controls` when I don't pass the parameter i.e. simply `[video
src="https://www.youtube.com/watch?v=NhheiPTdZCw"]`.
I have made some further changes in the code. It now first checks whether
`controls` is at all set. If yes, it looks for values "on", "true" or "1".
If any of these is found `controls="controls"` gets added to the markup.
For everything else (with `controls` parameter set) the attribute will be
ignored while rendering the output markup.
And if the parameter is not set at all, the attribute will never be added
to the markup.
Replying to [comment:7 paulschreiber]:
> I've updated the patch to:
> (a) allow more false values (false, off, 0)
> (b) use WordPress coding style
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40590#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list