Themes: Allow flexible sizes for custom header uploads
|Reported by:||lancewillett||Owned by:||ryan|
|Cc:||ian@…, mv@…, lance@…, azizur, iamtakashi, aaroncampbell, sabreuse@…, fpb_gns, jeremy@…, chip@…, mike@…|
Description (last modified by lancewillett)
If a theme allows flexible header images the custom header feature should adjust the crop settings on upload to let the image through.
add_theme_support( 'flexible_header_image_upload', 1000, 200 );
Where 1000 is the maximum width and 200 is the maximum height allowed.
Custom Header Code
If the theme_support option exists and passes second argument (dimension as an integer), and the uploaded image dimension is higher, crop to size. If the uploaded image dimension is lower, save it with no crop.
If the option is on but dimension value is false or 0, let any size through (no crop at all).
If a theme supports this, list the maximum dimensions in Appearance > Header. If no maximums are defined, leave it blank.
Change History (103)
- Cc lance@… added
- Keywords 2nd-opinion added
- Summary changed from Themes: Allow users to set the height for custom header image to Themes: Allow any size custom header image
- Description modified (diff)
- Summary changed from Themes: Allow any size custom header image to Themes: Allow flexible sizes for custom header uploads
- Keywords has-patch dev-feedback added; needs-patch 2nd-opinion removed
- Owner set to ryan
- Resolution set to fixed
- Status changed from new to closed