Make WordPress Core

Opened 2 days ago

#66733 assigned enhancement

Comments: Generalize ping handling with an `is_ping` comment type flag

Reported by: adamsilverstein Owned by: adamsilverstein
Priority: normal Milestone: 7.3
Component: Comments Version:
Severity: normal Keywords:
Cc: Focuses: template

Description

Follow-up to #35214, which introduces register_comment_type().

Core treats pingback and trackback specially by comparing type strings in several places. A plugin type that behaves like a ping (a webmention, for example) cannot opt in to that handling.

Proposal

Add an is_ping flag to WP_Comment_Type, set on the built-in pingback and trackback, and use it in place of the string comparisons:

  • separate_comments() places every registered ping type in the pings bucket.
  • Walker_Comment uses the compact ping markup for them, labeled with the type's own name.
  • A WP_Comment_Query for 'pings' expands to every registered ping type, and excluding 'pings' excludes them.

Built-in behavior is unchanged.

Not covered here, and left for later tickets: the check_comment() author and email skip for pings, and get_comment_class().

Patch

​https://github.com/adamsilverstein/wordpress-develop/pull/54 (stacked on the display callback branch; will be opened against trunk once its parents are committed).

Change History (0)

Note: See TracTickets for help on using tickets.