Opened 9 years ago
Closed 9 years ago
#36327 closed defect (bug) (fixed)
Custom logo: the image size argument is not taking in account
Reported by: | imath | Owned by: | obenland |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Themes | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In this post on Make.WP.org
you explain we can set/get the image size of the custom logo this way :
add_image_size( 'theme-prefix-logo', 400, 175 ); add_theme_support( 'custom-logo', array( 'size' => 'theme-prefix-logo', ) );
Unfortunately it's not working anymore, the size argument is not kept in the add_theme_support()
function. As a result, the full size is always output. It looks like adding the size arguments to the defaults one is fixing the issue.
See suggested patch, attached to this ticket.
Attachments (2)
Change History (12)
#2
@
9 years ago
- Keywords dev-feedback added
- Milestone changed from Awaiting Review to 4.5
- Owner set to obenland
- Status changed from new to assigned
#4
@
9 years ago
- Keywords dev-feedback removed
- Milestone 4.5 deleted
- Resolution set to invalid
- Status changed from assigned to closed
I updated the post to reflect the new arguments and added a paragraph to explain the change:
[EDIT]: As of [37077], Custom Logo does not support the size argument anymore. Specifying the logo size in individual arguments has the advantage of only creating a special image file for the specific logo used (and not every image uploaded), and providing more parity with how Custom Header works.
#5
@
9 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
@obenland @ocean90
Fine, but then why using get_theme_support( 'custom-logo', 'size' );
in the function get_custom_logo()
as it's not possible to specify this size with add_theme_support() anymore ??
see https://core.trac.wordpress.org/browser/trunk/src/wp-includes/general-template.php#L879
It seems weird to me to use a function that can't return anything set by the theme....
So to be consistent i think you should allow the size argument or remove this get_theme_support( 'custom-logo', 'size' );
part...
#6
@
9 years ago
- Milestone set to 4.5
36327.diff removes the $size
reference from get_custom_logo()
.
This ticket was mentioned in Slack in #core by mike. View the logs.
9 years ago
#9
@
9 years ago
36327.diff Looks good.
It seems like the make/core post isn't updated yet to reflect the changes in [37077].