[wp-trac] [WordPress Trac] #31742: Customizer: use attachment ID to show current header

WordPress Trac noreply at wordpress.org
Mon Mar 23 18:19:56 UTC 2015

#31742: Customizer: use attachment ID to show current header
 Reporter:  sirbrillig    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
 `api.HeaderTool.ChoiceView` sets the current header image model
 (`api.HeaderTool.currentHeader`) by comparing the current image URL
 (`api.get().header_image`) to the model URL for each recently updated
 header image. This relies on the URLs being identical, which may not be
 the case if, for example, the value of `api.get().header_image` uses
 `https` and the value of the model's URL uses `http` (which is the case on

 I think it would be better to use the attachment ID to find the current
 header image. The attached patch modifies the check in
 `api.HeaderTool.ChoiceView` to compare the current image attachment ID
 (`api.get().header_image_data.attachment_id`) with the model attachment
 ID. Because sometimes the current header may not have an ID (eg: if it is
 set to `random-uploaded-image`), this also falls back to comparing the
 `choice` attribute.

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

More information about the wp-trac mailing list