WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 20 months ago

Last modified 19 months 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: Appearance Keywords: close
Focuses: Cc:

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 21 months ago.
Port for the 3.4 branch.

Download all attachments as: .zip

Change History (23)

comment:1 sabreuse21 months ago

  • Cc sabreuse@… added

comment:2 iandstewart21 months ago

  • Cc ian@… added

comment:3 mfields21 months ago

  • Cc michael@… added

comment:4 nacin21 months ago

  • Milestone changed from 3.5 to 3.4.2

comment:5 koopersmith21 months 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.

comment:6 philiparthurmoore21 months ago

  • Cc philip@… added

comment:7 bananastalktome21 months ago

  • Cc bananastalktome@… added

comment:8 koopersmith21 months 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

comment:9 koopersmith21 months ago

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

comment:10 koopersmith21 months ago

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

comment:11 koopersmith21 months ago

In [21385]:

Add @since documentation, see #21355.

comment:12 koopersmith21 months 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.

comment:13 koopersmith21 months ago

In [21386]:

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

koopersmith21 months ago

Port for the 3.4 branch.

comment:14 jjonesftw21 months 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!

comment:15 jjonesftw21 months ago

  • Cc justin@… added

comment:16 SergeyBiryukov21 months ago

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

comment:17 SergeyBiryukov20 months ago

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

comment:18 mau20 months ago

  • Cc ngomau@… added

comment:19 nacin20 months 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].

comment:20 nacin20 months 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.

comment:21 nacin20 months ago

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

Opened #21785.

comment:22 mor1019 months 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.