WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#21355 closed defect (bug) (fixed)

Crop header images inside the customizer

Reported by: koopersmith Owned by: koopersmith
Milestone: 3.4.2 Priority: normal
Severity: major Version: 3.4
Component: Customize Keywords: close
Focuses: Cc:
PR Number:

Description

3.4 shipped without the ability to crop header images inside the customizer. This is both sub-optimal and causes a bug.

If a header image is uploaded through the customizer, the theme's header image size restrictions are not enforced, which can lead to oversized headers and broken themes. By adding a crop step, we can ensure the header image is properly sized.

Attachments (1)

21355-for-branch.diff (4.7 KB) - added by koopersmith 7 years ago.
Port for the 3.4 branch.

Download all attachments as: .zip

Change History (23)

#1 @sabreuse
7 years ago

  • Cc sabreuse@… added

#2 @iandstewart
7 years ago

  • Cc ian@… added

#3 @mfields
7 years ago

  • Cc michael@… added

#4 @nacin
7 years ago

  • Milestone changed from 3.5 to 3.4.2

#5 @koopersmith
7 years ago

  • Owner set to koopersmith
  • Status changed from new to accepted

For 3.4.2, let's pull the ability to upload custom headers through the customizer. I'll whip up a patch.

#6 @philiparthurmoore
7 years ago

  • Cc philip@… added

#7 @bananastalktome
7 years ago

  • Cc bananastalktome@… added

#8 @koopersmith
7 years ago

In [21383]:

Remove the ability to upload custom headers in the customizer. Properly handle selecting the correct first tab, and removing the control/section if no tabs exist. see #21355.

To check if the control has any potential tabs and headers, added:

  • WP_Customize_Image_Control->prepare_control()
  • WP_Customize_Header_Image_Control->prepare_control()
  • WP_Customize_Header_Image_Control->default_headers
  • WP_Customize_Header_Image_Control->uploaded_headers

#9 @koopersmith
7 years ago

Note that these changes still need to be ported to the 3.4 branch.

#10 @koopersmith
7 years ago

We'll also need to port [21379] and [21380] to prevent Plupload bugs — see #21437.

#11 @koopersmith
7 years ago

In [21385]:

Add @since documentation, see #21355.

#12 @koopersmith
7 years ago

  • Keywords has-patch needs-testing added

21355-for-branch.diff ports these changes to the 3.4 branch. For testing, I recommend testing on Twenty Eleven and adding Twenty Twelve to your 3.4 checkout, as it allows for custom headers but currently does not register any custom headers by default.

The behavior should work as follows:

  1. The "upload new" tab should never appear.
  1. If header images for this theme have been previously uploaded, there should be an "uploaded" tab. This tab should be selected by default.
  1. If there are default images, there should be a "default" tab. If there are no previously uploaded images, the "default" tab should be selected by default.
  1. If there are no previously uploaded or default header images, then both the header image control and section should be completely hidden.

#13 @koopersmith
7 years ago

In [21386]:

Fix @since blocks... since we already released 3.4.1. see #21355.

@koopersmith
7 years ago

Port for the 3.4 branch.

#14 @jjonesftw
7 years ago

I noticed this also. Created #21490 before @jkudish pointed me toward this ticket. Excited to see the ability to crop header image from the customizer!

#15 @jjonesftw
7 years ago

  • Cc justin@… added

#16 @SergeyBiryukov
7 years ago

[21383] broke the customizer for themes without custom header support: #21515.

#17 @SergeyBiryukov
7 years ago

[21383] also broke the customizer in IE for themes with custom header support: #21707.

#18 @mau
7 years ago

  • Cc ngomau@… added

#19 @nacin
7 years ago

In [21724]:

Remove custom header uploads from the customizer.

For the 3.4 branch. It will return when crop ability is added.

props koopersmith.
see #21355. fixes #21515. fixes #21707.
merges [21379] [21380] [21383] [21385] [21386] [21497] [21722].

#20 @nacin
7 years ago

  • Keywords close added; has-patch needs-testing removed

Due to the activity on here, I am thinking we should close this as fixed for 3.4.2 and open a new ticket to add it back with cropping for 3.5.

#21 @nacin
7 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Opened #21785.

#22 @mor10
7 years ago

Just piping in with my two cents: When a feature like this is removed - and especially when the feature looks like it disappears entirely like this one does - it is important to make it known in the release documentation. A lot of people are asking why the Header Image function no longer appears in the Customizer when they activate a new theme like Twenty Twelve. For increased usability and less confusion the option should be greyed out in the customizer rather than disappear because right now it's just plain confusing to anyone who hasn't read this thread.

Note: See TracTickets for help on using tickets.