[wp-trac] [WordPress Trac] #36877: Custom Logo default sizing inconsistencies
WordPress Trac
noreply at wordpress.org
Tue Jun 14 11:40:55 UTC 2016
#36877: Custom Logo default sizing inconsistencies
-------------------------------+------------------------------
Reporter: ambrosey | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.5
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by ocean90):
* keywords: => reporter-feedback
* version: trunk => 4.5
Old description:
> Per a discussion on #docs with @parsmizban , it appears that default use
> of
> {{{
> add_theme_support('custom_logo');
> }}}
> without extra arguments should pass null values for height and width,
> and true values for flex width and flex height given wp-
> includes/theme.php
>
> {{{#!php
> case 'custom-logo':
> if ( ! is_array( $args ) ) {
> $args = array( 0 => array() );
> }
> $defaults = array(
> 'width' => null,
> 'height' => null,
> 'flex-width' => false,
> 'flex-height' => false,
> 'header-text' => '',
> );
> $args[0] = wp_parse_args( array_intersect_key(
> $args[0], $defaults ), $defaults );
> // Allow full flexibility if no size is
> specified.
> if ( is_null( $args[0]['width'] ) && is_null(
> $args[0]['height'] ) ) {
> $args[0]['flex-width'] = true;
> $args[0]['flex-height'] = true;
> }
> break;
> }}}
>
> however, given
>
> /wp-includes/customize/class-wp-customize-cropped-image-control.php
> {{{#!php
> <?php
> /**
> * Suggested width for cropped image.
> *
> * @since 4.3.0
> * @access public
> * @var int
> */
> public $width = 150;
> /**
> * Suggested height for cropped image.
> *
> * @since 4.3.0
> * @access public
> * @var int
> */
> public $height = 150;
>
> }}}
>
> it is acting as 150px x 150px for the passed height and width. Is this
> intentional behavior? Should the suggested size actually be coming
> through for custom logo? Cropping is working as flex width and height, so
> it's only the "displayed" suggested size that is in question.
>
> https://wordpress.slack.com/archives/docs/p1463577732000750
>
> To reproduce: new install of WordPress, install TwentySixteen with edited
> functions.php file to remove array parameter on line 72.
New description:
Per a discussion on #docs with @parsmizban , it appears that default use
of
{{{
add_theme_support('custom_logo');
}}}
without extra arguments should pass null values for height and width, and
true values for flex width and flex height given wp-includes/theme.php
{{{#!php
case 'custom-logo':
if ( ! is_array( $args ) ) {
$args = array( 0 => array() );
}
$defaults = array(
'width' => null,
'height' => null,
'flex-width' => false,
'flex-height' => false,
'header-text' => '',
);
$args[0] = wp_parse_args( array_intersect_key(
$args[0], $defaults ), $defaults );
// Allow full flexibility if no size is specified.
if ( is_null( $args[0]['width'] ) && is_null(
$args[0]['height'] ) ) {
$args[0]['flex-width'] = true;
$args[0]['flex-height'] = true;
}
break;
}}}
however, given
/wp-includes/customize/class-wp-customize-cropped-image-control.php
{{{#!php
<?php
/**
* Suggested width for cropped image.
*
* @since 4.3.0
* @access public
* @var int
*/
public $width = 150;
/**
* Suggested height for cropped image.
*
* @since 4.3.0
* @access public
* @var int
*/
public $height = 150;
}}}
it is acting as 150px x 150px for the passed height and width. Is this
intentional behavior? Should the suggested size actually be coming through
for custom logo? Cropping is working as flex width and height, so it's
only the "displayed" suggested size that is in question.
https://wordpress.slack.com/archives/docs/p1463577732000750
To reproduce: new install of WordPress, install TwentySixteen with edited
functions.php file to remove array parameter on line 72.
--
Comment:
Hello @ambrosey, welcome to our Trac!
> so it's only the "displayed" suggested size that is in question.
Can you explain what you mean by that?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36877#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list