Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21759 closed enhancement (fixed)

Twenty Twelve: Author name is always displayed even on a single author blog

Reported by: iamtakashi's profile iamtakashi Owned by: lancewillett's profile lancewillett
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

Not like Twenty Ten and Twenty Eleven, Twenty Twelve displays author name on a single author blog.

Creating twentytwelve_entry_meta() in a child theme allows users to overide the output but I've heard a feedback pointing that it's overkill to get some privacy.

Like Twenty Ten and Twenty Eleven, wrapping each piece of the entry meta including prepositions such as "in", "on", and "by" provides flexibility but it certainly adds complexity.

Do you guys think Twenty Twelve also should hide author name on a single author blog like Twenty Ten and Twenty Eleven do? If so what's the best approach?

Attachments (4)

21579.diff (2.0 KB) - added by iamtakashi 12 years ago.
Hiding author name on a single-author blog with CSS.
21759.2.diff (1.7 KB) - added by lancewillett 12 years ago.
21759.3.diff (1.2 KB) - added by SergeyBiryukov 12 years ago.
21759.4.diff (1.4 KB) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (18)

#1 @nacin
12 years ago

I wasn't really aware that hiding the name when there is only one author is a privacy thing. Makes sense, but I had always assumed it was to de-clutter the theme and not show redundant information, which for a single-author blog looks sterile or at least impersonal.

Also note that Twenty Eleven doesn't hide the HTML. It does this:

.single-author .entry-meta .by-author {
	display: none;
}

And .single-author is outputted using twentyeleven_body_classes().

#2 @lancewillett
12 years ago

  • Milestone changed from Awaiting Review to 3.5

Related to #21768 in terms of extra markup for hiding things with CSS.

#3 follow-up: @lancewillett
12 years ago

I like this approach for single-user blogs — not hiding the HTML output so that an author can choose to display it they'd like.

@iamtakashi Want to cook up a patch for Twenty Twelve?

#4 in reply to: ↑ 3 @iamtakashi
12 years ago

Replying to lancewillett:

@iamtakashi Want to cook up a patch for Twenty Twelve?

Sure. I'll make a patch today.

@iamtakashi
12 years ago

Hiding author name on a single-author blog with CSS.

#5 @iamtakashi
12 years ago

  • Keywords needs-testing has-patch added

#6 @lancewillett
12 years ago

  • Keywords needs-testing removed

#7 follow-up: @lancewillett
12 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In [21761]:

Twenty Twelve: hide author name on single author blogs, using is_multi_author() -- fixes #21759, props iamtakashi.

#8 follow-up: @nacin
12 years ago

Not sure this is translatable as a full sentence. Twenty Eleven doesn't appear to be much better.

#9 in reply to: ↑ 7 ; follow-ups: @westi
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to lancewillett:

In [21761]:

Twenty Twelve: hide author name on single author blogs, using is_multi_author() -- fixes #21759, props iamtakashi.

Please can we not put the span in the translatable string.

In unnecessarily breaks all previous translations and is something that doesn't need translating.

It would be better to add the span around the replacement string before passing it to sprintf as this keeps the translation "simple"

#10 in reply to: ↑ 9 @SergeyBiryukov
12 years ago

Replying to westi:

It would be better to add the span around the replacement string before passing it to sprintf as this keeps the translation "simple"

21759.3.diff is an attempt to do that, but it wouldn't allow swapping %3$s and %4$s, which is bad.

Adding the span to $author alone doesn't seem feasible without adding new placeholders in this case, since it needs to include "by".

21759.4.diff adds new placeholders, not sure if it looks better than [21761].

[21761] is flexible enough, I guess I'd prefer to leave it as is.

#11 in reply to: ↑ 8 @SergeyBiryukov
12 years ago

Replying to nacin:

Not sure this is translatable as a full sentence. Twenty Eleven doesn't appear to be much better.

In Twenty Eleven, the string was much more sophisticated:
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-content/themes/twentyeleven/functions.php#L580

twentytwelve_entry_meta() looks better in that sense.

#12 in reply to: ↑ 9 @lancewillett
12 years ago

Replying to westi:

Please can we not put the span in the translatable string.
It would be better to add the span around the replacement string before passing it to sprintf as this keeps the translation "simple"

Can you suggest how you'd do it better with a patch? I'm not sure moving the span elements out is better because the " by " glue piece should be in the sentence, not in a replacement string.

#13 @lancewillett
12 years ago

Seems to me we're deciding between three options:

  1. HTML in the translatable string
  2. Splitting out the " by " English string into its own translation

3.

Westi said:

In unnecessarily breaks all previous translations and is something that doesn't need translating.

This theme is not yet live except for on WP.com, so changing the string isn't a huge deal in my opinion. After 1.0 is on Extend we'll freeze strings as much as possible.

The third option keeps it clean but adds a bunch of sprintf placeholders, which just looks terrible from a code bloat perspective.

Version 0, edited 12 years ago by lancewillett (next)

#14 @lancewillett
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Discussed all the options with SergeyBiryukov and Obenland in IRC today, and we all agreed that the way it is now is the most transparent.

Closing as fixed since it worksforus.

Note: See TracTickets for help on using tickets.