[wp-trac] [WordPress Trac] #38550: Remove jQuery dependency from wp-custom-header.js

WordPress Trac noreply at wordpress.org
Wed Nov 2 17:37:11 UTC 2016


#38550: Remove jQuery dependency from wp-custom-header.js
--------------------------+-------------------------
 Reporter:  joemcgill     |       Owner:  joemcgill
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.7
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------

Comment (by bradyvercher):

 I like the idea of removing the jQuery dependency, but after tinkering a
 bit, it might be more helpful if we go all in with jQuery instead.

 If I recall correctly, play and pause buttons are required for
 accessibility, so those would likely need to be inserted dynamically. It
 would be less verbose with jQuery, while some of the existing code could
 also be simplified a bit.

 Most themes are going to be using jQuery, so they'll understand how to
 listen for events using it. With this approach, they'll have to learn an
 alternative approach. Granted it is a native API, so that learning
 experience could be worthwhile, depending on your vantage point.

 It's not a major deal either way, I just thought I'd throw that out there.

 Based on some testing, there are some additional changes that need to
 happen here, though. The `supportsVideo()` method needs to be overridable
 from a theme or plugin, but it's currently called privately, so it can't
 be replaced. Should I upload a patch to show what that might look like?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38550#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list