[wp-trac] [WordPress Trac] #29040: Customizer: Header Image not Updating when using static front page

WordPress Trac noreply at wordpress.org
Wed Jun 3 14:37:06 UTC 2015


#29040: Customizer: Header Image not Updating when using static front page
-------------------------------+------------------------------
 Reporter:  zhalsey            |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  3.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript
-------------------------------+------------------------------

Comment (by carlalexander):

 I did some more digging. The `get_default_header_images` method merges the
 `default-image` into the `default_headers` array correctly. The issue
 seems to be that it isn't used by the `Custom_Image_Header` class. It's
 only used by `WP_Customize_Control` to display the image on the customizer
 page.

 The issue can be solved by just using the `get_default_header_images`
 method in `set_header_image` as followed:

 {{{
 if ( $uploaded && isset( $uploaded[ $choice ] ) ) {
         $header_image_data = $uploaded[ $choice ];
 } else {
         $default_headers = $this->get_default_header_images();

         if ( isset( $default_headers[ $choice ] ) )
                 $header_image_data = $default_headers[ $choice ];
         else
                 return;
 }
 }}}

 What I can't tell is if this is a larger issue. It seems like
 `get_default_header_images` should be used at several other places. I'm
 also unclear why it isn't merged into the `default_headers` by default. It
 is a default header.

 Either way, it seems like the relationship between
 `get_default_header_header_images`  and `process_default_headers` should
 be tighter. I'll let someone with a better knowledge of the Customizer
 internals make that decision though.

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


More information about the wp-trac mailing list