Opened 8 years ago
Closed 8 years ago
#38544 closed defect (bug) (fixed)
Header Visuals > Header Video Vimeo url don't work
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | ui, javascript | Cc: |
Description
In Customizer in Header Visuals Section on Header Video option, when I paste a Vimeo url, for example
https://vimeo.com/185808340, the background header didn't appear, with Youtube it works as well.
Attachments (4)
Change History (22)
#1
@
8 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.7
- Owner set to joemcgill
- Status changed from new to accepted
This ticket was mentioned in Slack in #core-themes by joemcgill. View the logs.
8 years ago
#3
@
8 years ago
Vimeo currently only supports background videos for Plus and PRO members and it's only experimental at this point, so there isn't a core handler for it.
The label in the Customizer needs to be updated to indicate that only YouTube is supported for now. There's also a validator for the external_video_header
setting that probably needs to be updated or removed if it won't allow plugins to add additional handlers.
I'll try to put together a plugin to add Vimeo support as a proof of concept to see if anything needs to be adjusted to make adding new handlers easier.
#4
@
8 years ago
custom-header-vimeo.php is a basic plugin for adding Vimeo support. It uses their official player API, which doesn't contain support for the background
setting mentioned earlier. To set that, the iframe would need to be constructed manually, but this at least shows how a custom handler can be registered.
#5
@
8 years ago
Plugins can hook into the customizer validity filter to remove an invalid notice if there's a source they're adding. So I think adjusting the label is all that will be needed here. This should definitely live as a plugin for now, and would be good to see it on .org if someone's able to make a fully-fledged version.
#6
@
8 years ago
Since the consensus is that we can't support Vimeo URLs by default, 38544.diff removes the reference to Vimeo from the description for the external header video controls.
#9
@
8 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
_validate_external_header_video()
should be updated as well. It's confusing that the error message says that you should enter a Vimeo URL even if it's not supported.
#10
@
8 years ago
Also, in \WP_Customize_Manager::_validate_external_header_video()
it’s using esc_url()
with a (default) display
context. It probably won’t impact the validation logic as it stands right now, but esc_url()
will inject HTML entities into the returned string, so that could cause unexpected behavior. In short, I think this should be changed to use esc_url_raw()
instead.
#11
@
8 years ago
In 38544.2.diff:
- updated error message
- replaces
esc_url
withesc_url_raw
(correct although benign in this context)
#13
@
8 years ago
- Keywords commit added
Good catch @ocean90 and @westonruter. 38544.2.diff looks good (thanks @peterwilsoncc).
#15
@
8 years ago
- Keywords needs-patch added; has-patch commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
Was just commenting while @joemcgill committed [39148] :) I'd say to remove references to Vimeo from the inline documentation too, see * Ensures that the provided URL is for YouTube or Vimeo.
. Probably also remove the regex for Vimeo from get_header_video_settings()
#16
@
8 years ago
- Keywords has-patch added; needs-patch removed
38544.3.diff removes the mime type logic for Vimeo URLs from get_header_video_settings()
and cleans up the docs for _validate_external_header_video()
.
Thanks @llemurya.
We currently don't have a handler defined to handle Vimeo URLs in
wp-custom-header.js
. We either need to write one, similar to theyoutubeHandler()
or note that only YouTube is supported in WordPress 4.7 and update the helper text in the customizer to be more accurate.Additionally, we should consider how themes or plugins could extend the core functionality by adding their own handlers.