Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#36327 closed defect (bug) (fixed)

Custom logo: the image size argument is not taking in account

Reported by: imath Owned by: obenland
Priority: normal Milestone: 4.5
Component: Themes Version: 4.6
Severity: normal Keywords: has-patch commit
Cc: Focuses:

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)

36327.patch (375 bytes ) - added by imath 10 years ago.
36327.diff (2.9 KB ) - added by ocean90 10 years ago.

Download all attachments as: .zip

Change History (12)

@imath
10 years ago

#1 @imath
10 years ago

  • Keywords has-patch added

#2 @DrewAPicture
10 years ago

  • Keywords dev-feedback added
  • Milestone Awaiting Review4.5
  • Owner set to obenland
  • Status newassigned

#3 @ocean90
10 years ago

It seems like the make/core post isn't updated yet to reflect the changes in [37077].

#4 @obenland
10 years ago

  • Keywords dev-feedback removed
  • Milestone 4.5
  • Resolutioninvalid
  • Status assignedclosed

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 @imath
10 years ago

  • Resolution invalid
  • Status closedreopened

@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 @ocean90
10 years ago

  • Milestone4.5

36327.diff removes the $size reference from get_custom_logo().

@ocean90
10 years ago

#7 @obenland
10 years ago

  • Keywords commit added

This ticket was mentioned in Slack in #core by mike. View the logs.


10 years ago

#10 @obenland
10 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 37135:

Template: Remove $size reference from get_custom_logo().

Argument was removed in [37077] in favor of with and height arguments.

Props ocean90.
Fixes #36327.

Note: See TracTickets for help on using tickets.