Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#38403 closed defect (bug) (fixed)

Twenty Seventeen: Comment by post author SVG

Reported by: samikeijonen's profile samikeijonen Owned by: davidakennedy's profile davidakennedy
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

There is still missing SVG icon in "comment by post author". I'd like to add this icon directly to HTML but not sure if that's possible. It would require some sort of is_comment_and_post_author function and perhaps also custom callback function.

Or use JS for this like we possible need for quote post format icon.

This issue is also note and reminder for myself.

Attachments (2)

38403.patch (4.2 KB) - added by laurelfulford 9 years ago.
bypostauthor-comment-mock.png (42.5 KB) - added by laurelfulford 9 years ago.

Download all attachments as: .zip

Change History (5)

@laurelfulford
9 years ago

#1 @laurelfulford
9 years ago

  • Keywords has-patch added; needs-patch removed

I investigated a couple ways to add the .bypostauthor SVG icon inline, but both seem a bit too much for this one thing. I tried the following:

  • Adding a filter to append it to the author name using get_comment_author; unfortunately this adds it everywhere, and even when restricted to single posts and pages affects comments in widgets. We can hide with CSS, but that seems hacky.
  • Creating a Comment Walker or callback (like how Twenty Twelve handles adding the string 'post author'). Twenty Seventeen doesn't actually change any other markup in the comments, though, so this seems like overkill.

I discussed with @melchoyce and she suggested altering the design a bit to avoid doing anything over the top to add the SVG (mockup attached). The patch adds that design, plus updates rtl.css, colors-dark.css, and color-patterns.php.

#2 @sami.keijonen
9 years ago

There should be way to add HTML by Core without custom callback. And is_comment_and_post_author function would be nice too.

#3 @davidakennedy
9 years ago

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

In 38865:

Twenty Seventeen: Add post author comment styles

Currently, it's hard to output an SVG in the comment function without a lot of extra effort. So this adds a simple border to the author avatar and removes previous code related to SVGs and/or Genericons.

Props laurelfulford.

Fixes #38403.

Note: See TracTickets for help on using tickets.