[wp-trac] [WordPress Trac] #36877: Custom Logo default sizing inconsistencies

WordPress Trac noreply at wordpress.org
Wed May 18 13:38:06 UTC 2016


#36877: Custom Logo default sizing inconsistencies
--------------------------+-----------------------------
 Reporter:  ambrosey      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36877>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list