[wp-trac] [WordPress Trac] #20088: Improve wp_list_comments() comment markup

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 28 17:26:08 UTC 2012


#20088: Improve wp_list_comments() comment markup
------------------------------------+------------------------------
 Reporter:  lancewillett            |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Comments                |     Version:  3.3.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------
Description changed by lancewillett:

Old description:

> The default comment markup generated by `wp_list_comments()` needs a
> small revamp. This will potentially help theme authors avoid using their
> own comment callback functions by incorporating a structure popularized
> by the last two default themes.
>
> Twenty Twelve, for example, could ''almost'' drop the custom comments
> callback in `functions.php` with these improvements, with the exception
> of not being able to use HTML5 semantic elements instead of `div`s.
>
> Patch has code cleanup and improvements to the `comment-template.php`
> file, including:
>
> `start_lvl()`
>
>  * Use double quotes for HTML output
>
> `end_lvl()`
>
>  * Add in `.children` end element HTML comments
>
> `start_el()`
>
>  * Add switch statement for handling pingback/trackback first, to run
> before "other" types of comments
>  * Add pingback/trackback HTML output based on Twenty Ten / Eleven: much
> simpler than normal comments
>  * Wrap `comment_text()` in a div element so it can be styled separately
>  * Use `comment-body` class for comment text block, not for the entire
> wrapper div element
>  * Change `comment-awaiting-moderation` to be wrapped in a paragraph
> element, removing presentational line break
>  * Use updated `comment-meta` data based on Twenty Ten / Eleven:  include
> an author link (if it exists), better time/date formatting, and use
> `esc_url` instead of `htmlspecialchars`
>  * Add in several end element HTML comments
>  * Fix spacing around parens
>  * Better indenting for PHP and HTML code throughout
>
> `end_el()`
>
>  * Fix spacing around parens
>  * Add in `#comment-##` end element HTML comments

New description:

 The default comment markup generated by `wp_list_comments()` needs a small
 revamp. This will potentially help theme authors avoid using their own
 comment callback functions by incorporating a structure popularized by the
 last two default themes.

 Twenty Twelve, for example, could ''almost'' drop the custom comments
 callback in `functions.php` with these improvements, with the exception of
 not being able to use HTML5 semantic elements instead of `div`s.

 Patch has code cleanup and improvements to the `comment-template.php`
 file, including:

 `start_lvl()`

  * Use double quotes for HTML output

 `end_lvl()`

  * Add in `.children` end element HTML comments

 `start_el()`

  * Add switch statement for handling pingback/trackback first, to run
 before "other" types of comments
  * Add pingback/trackback HTML output based on Twenty Ten / Eleven: much
 simpler than normal comments
  * Wrap `comment_text()` in a div element so it can be styled separately
  * Change `comment-awaiting-moderation` to be wrapped in a paragraph
 element, removing presentational line break
  * Use updated `comment-meta` data based on Twenty Ten / Eleven:  include
 an author link (if it exists), better time/date formatting, and use
 `esc_url` instead of `htmlspecialchars`
  * Add in several end element HTML comments
  * Fix spacing around parens
  * Better indenting for PHP and HTML code throughout

 `end_el()`

  * Fix spacing around parens
  * Add in `#comment-##` end element HTML comments

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20088#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list