WordPress.org

Make WordPress Core

Ticket #7435: comment-action-link-classes.diff

File comment-action-link-classes.diff, 1.1 KB (added by caesarsgrunt, 6 years ago)

Allows action links to specify additional class names such as hide-if-no-js.

  • wp-admin/includes/template.php

     
    10341034                } 
    10351035 
    10361036                if ( 'spam' != $the_comment_status ) 
    1037                         $actions['reply'] = '<span class="hide-if-no-js"> | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a></span>'; 
     1037                        $actions['reply'] = array(' | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>', 'hide-if-no-js'); 
    10381038 
    10391039                $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 
    10401040 
    1041                 foreach ( $actions as $action => $link ) 
    1042                         echo "<span class='$action'>$link</span>\n"; 
     1041                foreach ( $actions as $action => $link ) { 
     1042                        if (is_array($link) && count($link > 1)) 
     1043                                echo "<span class='$action $link[1]'>$link[0]</span>\n"; 
     1044                        else 
     1045                                echo "<span class='$action'>$link</span>\n"; 
     1046                } 
    10431047        } 
    10441048        ?> 
    10451049    </td>