Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dev/tests/php/test-template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ public function test_site_branding_custom_logo_h1() {

set_theme_mod( 'custom_logo', $featured_image_id );

$this->expectOutputRegex( '/<h1 class="custom-logo"><a href="http:\/\/localhost:8889\/" class="custom-logo-link" rel="home">(<img)([^<]*|[^>]*)(.*\/>)<\/a><\/h1>/' );
$this->expectOutputRegex( '/<div class="custom-logo"><a href="http:\/\/localhost:8889\/" class="custom-logo-link" rel="home">(<img)([^<]*|[^>]*)(.*\/>)<\/a><\/div>/' );

Go\site_branding();

Expand Down
4 changes: 2 additions & 2 deletions includes/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -842,13 +842,13 @@ function site_branding( $args = array() ) {
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {

/**
* Wrap the custom logo in an h1 element when the hiding the site title & tagline.
* Wrap the custom logo in a div container when hiding the site title & tagline.
*/
add_filter(
'get_custom_logo',
function ( $html ) use ( $hide_title ) {

return $hide_title ? '<h1 class="custom-logo">' . $html . '</h1>' : $html;
return $hide_title ? '<div class="custom-logo">' . $html . '</div>' : $html;
},
PHP_INT_MAX
);
Expand Down