diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index e8e936cbc4..8a3a71cd6c 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -878,6 +878,10 @@ function get_custom_logo( $blog_id = 0 ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); $size = get_theme_support( 'custom-logo', 'size' ); + if ( ! $size ) { + $size = 'full'; + } + // We have a logo. Logo is go. if ( $custom_logo_id ) { $html = sprintf( '', diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php index c7807e2c28..d50ee884e4 100644 --- a/tests/phpunit/tests/general/template.php +++ b/tests/phpunit/tests/general/template.php @@ -280,6 +280,7 @@ class Tests_General_Template extends WP_UnitTestCase { $this->_set_custom_logo(); $home_url = get_home_url( $blog_id, '/' ); $size = get_theme_support( 'custom-logo', 'size' ); + $size = $size ? $size : 'full'; $image = wp_get_attachment_image( $this->custom_logo_id, $size, false, array( 'class' => "custom-logo attachment-$size", 'data-size' => $size, @@ -302,6 +303,7 @@ class Tests_General_Template extends WP_UnitTestCase { $this->_set_custom_logo(); $size = get_theme_support( 'custom-logo', 'size' ); + $size = $size ? $size : 'full'; $image = wp_get_attachment_image( $this->custom_logo_id, $size, false, array( 'class' => "custom-logo attachment-$size", 'data-size' => $size,