Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 9bfd713

Browse files
committed
Merge pull request #28 from dshanske/master
Change Comment Class Map to allow multiple class names
2 parents 0f59d17 + 63fab81 commit 9bfd713

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

semantic-linkbacks.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public static function comment_text_add_cite($text, $comment = null, $args = arr
290290
public static function comment_text_excerpt($text, $comment = null, $args = array()) {
291291
$semantic_linkbacks_type = get_comment_meta($comment->comment_ID, "semantic_linkbacks_type", true);
292292

293-
// only change text for pinbacks/trackbacks/webmentions
293+
// only change text for pingbacks/trackbacks/webmentions
294294
if (!$comment ||
295295
$comment->comment_type == "" ||
296296
$semantic_linkbacks_type == "reply") {
@@ -406,27 +406,27 @@ public static function comment_class($classes, $class, $comment_id, $post_id) {
406406
// get comment
407407
$comment = get_comment($comment_id);
408408

409-
// "commment type to class" mapper
409+
// "comment type to class" mapper
410410
$class_mapping = array(
411-
'mention' => 'h-as-mention',
412-
413-
'reply' => 'h-as-reply',
414-
'repost' => 'h-as-repost',
415-
'like' => 'h-as-like',
416-
'favorite' => 'h-as-favorite',
417-
'tag' => 'h-as-tag',
418-
'rsvp:yes' => 'h-as-rsvp',
419-
'rsvp:no' => 'h-as-rsvp',
420-
'rsvp:maybe' => 'h-as-rsvp',
421-
'rsvp:invited' => 'h-as-rsvp',
422-
'rsvp:tracking' => 'h-as-rsvp'
411+
'mention' => array('h-as-mention'),
412+
413+
'reply' => array('h-as-reply'),
414+
'repost' => array('h-as-repost', 'p-repost'),
415+
'like' => array('h-as-like', 'p-like'),
416+
'favorite' => array('h-as-favorite', 'p-favorite'),
417+
'tag' => array('h-as-tag', 'p-tag'),
418+
'rsvp:yes' => array('h-as-rsvp'),
419+
'rsvp:no' => array('h-as-rsvp'),
420+
'rsvp:maybe' => array('h-as-rsvp'),
421+
'rsvp:invited' => array('h-as-rsvp'),
422+
'rsvp:tracking' => array('h-as-rsvp')
423423
);
424424

425425
$semantic_linkbacks_type = get_comment_meta($comment->comment_ID, 'semantic_linkbacks_type', true);
426426

427427
// check the comment type
428428
if ($semantic_linkbacks_type && isset($class_mapping[$semantic_linkbacks_type])) {
429-
$classes[] = $class_mapping[$semantic_linkbacks_type];
429+
$classes = array_merge($classes, $class_mapping[$semantic_linkbacks_type]);
430430

431431
$classes = array_unique($classes);
432432
}

0 commit comments

Comments
 (0)