Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#26505 closed enhancement (duplicate)

Custom Header cropping code extraction

Reported by: ehg's profile ehg Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Customize Keywords:
Focuses: Cc:

Description

@miguelcsf and I are working on implementing cropping for the Customizer's Header section (which will address #21785). We wanted to extract some common code we copied from wp-admin/custom-header.php's step_3() into a class that we can use in both our own code and Appearance -> Header.

I've attached a patch which contains this new class, the refactored custom-header.php and a few tests.

Feedback would be greatly appreciated!

Attachments (2)

custom-header-extraction.diff (14.0 KB) - added by ehg 11 years ago.
custom-header-extraction.2.diff (11.6 KB) - added by ehg 11 years ago.
don't create a new class, just add methods to custom-header.php

Download all attachments as: .zip

Change History (9)

#1 @nacin
11 years ago

The Customizer already uses functionality from the custom header class, via $custom_image_header. A narrower refactor would probably be to just decorate the existing class with the public methods you need. This is also much easier to maintain. Over time, the custom header screen will ideally be replaced by the customizer (same goes for background), so the two classes powering those sites will just end up being more generic classes used by the Customizer, plus some fallback functionality for when it needs to render its own page.

#2 @ehg
11 years ago

Thanks nacin - agreed. Submitting another patch!

@ehg
11 years ago

don't create a new class, just add methods to custom-header.php

#3 @mcsf
11 years ago

  • Cc mcsf added

#4 @ethitter
11 years ago

  • Cc erick@… added

#5 @ehg
11 years ago

  • Cc ehg added

#6 @ehg
11 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #21785.

#7 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.