[wp-trac] [WordPress Trac] #38639: Improve the user and developer experience for new custom header functions

WordPress Trac noreply at wordpress.org
Wed Nov 2 22:58:09 UTC 2016


#38639: Improve the user and developer experience for new custom header functions
--------------------------+-----------------------------
 Reporter:  bradyvercher  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The subject is a bit open-ended, but the custom header functionality
 currently feels a bit glitchy. As I've dug into the code over the past
 week, I've uncovered a few bugs that were present before video headers
 were introduced and have opened tickets for those. They make it difficult
 to really test the experience in the Customizer.

 I'm going to try to lay out a few concrete things that can be done to
 improve the new custom header functions that should hopefully create a
 much smoother experience for users in the Customizer as well as make it
 easer for theme authors to implement support in themes, especially as the
 pre-existing bugs are addressed.

 == Selective Refresh ==

 A Customizer partial is registered by default and uses
 `the_custom_header_markup()` for the render callback, which allows both
 header images and videos to automatically support selective refresh. If a
 header image or video hasn't been set, we don't want to output empty
 markup on the front end, however, the container div needs to exist in the
 Customizer for selective refresh to work. Otherwise, setting an image or
 video will result in a full refresh.

 `the_custom_logo()`, along with other features in core, output
 placeholders in the Customizer preview for the optimal experience, so
 making sure the container is always available in the preview isn't really
 breaking new ground. Themes can always use `.wp-custom-header:empty {
 display: none;}` to hide it if it causes styling issues in the preview.

 === Header Image Settings ===

 It may also be worth changing the transport for the `header_image` and
 `header_image_data` settings to `postMessage` automatically when the the
 theme registers support for videos. Otherwise, it's kind of a weird
 experience when videos use selective refresh and images don't.

 == Front Page Restriction ==

 I've been looking to incorporate this functionality in the
 [https://demo.audiotheme.com/marquee/ Marquee] theme and it feels broken
 if video only loads on the front page. This seems like a restriction that
 should be left up to the theme and is particularly difficult to workaround
 if a theme wants video on more than one page.

 Browsers should be caching local videos, which should minimize the
 bandwidth impact a bit. I think we should make the API broadly useful and
 document best practices instead of trying to enforce onerous restrictions.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38639>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list