#26505 closed enhancement (duplicate)
Custom Header cropping code extraction
Reported by: | 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)
Change History (9)
Note: See
TracTickets for help on using
tickets.
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.