WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 8 months ago

#44656 new defect (bug)

Empty site title leaves empty anchor tag in header

Reported by: tsquez Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.7
Component: Bundled Theme Keywords: needs-testing
Focuses: Cc:
PR Number:

Description

I just noticed something weird the other day with Twenty Twelve. I removed the title all together (no I did not hide it) and when I looked at the source code this is what I saw:

<h1 class="site-title">
	<a href="http://localhost/dev/" rel="home"></a>
</h1>

It's an H1 tag with an empty anchor? This shouldn't happen I don't think.

So I download a few other themes and did the same thing and sure enough all that was left was an empty H1 tag with an empty anchor tag.

I do not know why anyone would want to do this BUT If the site title is removed completely, meaning not hidden and not entered not entered either in "Settings" or "Site Identity" in the customizer, then the site H1 site title tag should not be displayed.

I am not sure if this is a bug so I thought I would enter it in. I looked all over and could not find any information or any other tickets regarding this.

I apologize if its a waste of time.

Thanks in advance.

Attachments (1)

44656.diff (1.2 KB) - added by audrasjb 13 months ago.
Adds site-title check before displaying it

Download all attachments as: .zip

Change History (7)

#1 @westonruter
15 months ago

  • Component changed from Customize to Bundled Theme

@audrasjb
13 months ago

Adds site-title check before displaying it

#2 @audrasjb
13 months ago

  • Keywords has-patch added

Hi and welcome to WordPress Trac, @tsquez !

Thanks for the ticket.

Even if it's a small edge case, I'd say we can easily solve it, so let's fix the issue :)

44656.diff adds a condition to check if get_bloginfo( 'name' ) is empty or not.

Cheers,

Jb

#3 @audrasjb
13 months ago

Oops, I didn't noticed you were talking about Twenty Twelve.

My patch is for Twenty Seventeen.

Of course, I can fix the issue on all bundled themes but I'm not sure we are still supporting old bundled themes for such a edge case… (cc @davidakennedy)

#4 @desrosj
9 months ago

  • Keywords needs-patch added; has-patch removed

@laurelfulford Do you have any thoughts as to whether this is something that should be fixed? It seems reasonable to move to Future Release, in my opinion.

#5 @laurelfulford
9 months ago

  • Milestone changed from Awaiting Review to Future Release

@desrosj Agreed! :)

Thanks for the ping -- I've been moving through these tickets backwards, but it's slow going!

#6 @nielslange
8 months ago

  • Keywords needs-testing added; needs-patch removed
Note: See TracTickets for help on using tickets.