[wp-trac] [WordPress Trac] #39512: has_header_video() should be filtered
WordPress Trac
noreply at wordpress.org
Sat Jan 21 19:49:47 UTC 2017
#39512: has_header_video() should be filtered
--------------------------+--------------------
Reporter: wpweaver | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.2
Component: Customize | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+--------------------
Comment (by wpweaver):
I only read code as deep as `has_header_video`. Filtering
`get_header_video_url` could work, but the logic would be a bit more
complicated. The current source of the url is either an internal
attachment ID or a url to an external link. Currently, either one of these
could generate the ultimate url, but the filter needs to be able to
provide a url even if the theme_mod values are null.
The logic of just where to apply the filter, and on which elements is
fairly non-trivial in `get_header_video_url`, but certainly solvable. How
to do it in `has_header_video` is simple.
But putting the filter in `get_header_video_url` would also make
`the_header_video_url` work as expected, so the filter really does belong
on `get_header_video_url`, but it will require new logic for the
attachment vs external video source to make a filter work.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39512#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list