diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index 618906f39b..50cce93413 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -108,8 +108,11 @@ function twentyfifteen_setup() { * * @since Twenty Fifteen 1.5 */ - add_image_size( 'twentyfifteen-logo', 248, 248 ); - add_theme_support( 'custom-logo', array( 'size' => 'twentyfifteen-logo' ) ); + add_theme_support( 'custom-logo', array( + 'height' => 248, + 'width' => 248, + 'flex-height' => true, + ) ); $color_scheme = twentyfifteen_get_color_scheme(); $default_color = trim( $color_scheme[0], '#' ); diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 370ebdddcd..8057e57ae0 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1959,11 +1959,15 @@ final class WP_Customize_Manager { 'transport' => 'postMessage', ) ); - $this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array( - 'label' => __( 'Logo' ), - 'section' => 'title_tagline', - 'priority' => 8, - 'mime_type' => 'image', + $custom_logo_args = get_theme_support( 'custom-logo' ); + $this->add_control( new WP_Customize_Cropped_Image_Control( $this, 'custom_logo', array( + 'label' => __( 'Logo' ), + 'section' => 'title_tagline', + 'priority' => 8, + 'height' => $custom_logo_args[0]['height'], + 'width' => $custom_logo_args[0]['width'], + 'flex_height' => $custom_logo_args[0]['flex-height'], + 'flex_width' => $custom_logo_args[0]['flex-width'], 'button_labels' => array( 'select' => __( 'Select logo' ), 'change' => __( 'Change logo' ), diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 1ad720c4f6..49ecdbbb3f 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1559,6 +1559,23 @@ function add_theme_support( $feature ) { $args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] ); break; + case 'custom-logo': + $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; + case 'custom-header-uploads' : return add_theme_support( 'custom-header', array( 'uploads' => true ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index afd784c97a..5112df1c3c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta4-37076'; +$wp_version = '4.5-beta4-37077'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.