Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_wp_dashboard_recent_comments_row [ WordPress Function ]

_wp_dashboard_recent_comments_row ( $comment, $show_date = true )
Defined at:



No description yet.

Source


<?php
function _wp_dashboard_recent_comments_row( &$comment$show_date true ) {
    
$GLOBALS['comment'] =& $comment;

    
$comment_post_url get_edit_post_link$comment->comment_post_ID );
    
$comment_post_title strip_tags(get_the_title$comment->comment_post_ID ));
    
$comment_post_link "<a href='$comment_post_url'>$comment_post_title</a>";
    
$comment_link '<a class="comment-link" href="' esc_url(get_comment_link()) . '">#</a>';

    
$actions_string '';
    if ( 
current_user_can'edit_comment'$comment->comment_ID ) ) {
        
// preorder it: Approve | Reply | Edit | Spam | Trash
        
$actions = array(
            
'approve' => '''unapprove' => '',
            
'reply' => '',
            
'edit' => '',
            
'spam' => '',
            
'trash' => '''delete' => ''
        
);

        
$del_nonce esc_html'_wpnonce=' wp_create_nonce"delete-comment_$comment->comment_ID) );
        
$approve_nonce esc_html'_wpnonce=' wp_create_nonce"approve-comment_$comment->comment_ID) );

        
$approve_url esc_url"comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce);
        
$unapprove_url esc_url"comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce);
        
$spam_url esc_url"comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce);
        
$trash_url esc_url"comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce);
        
$delete_url esc_url"comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce);

        
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" esc_attr__'Approve this comment' ) . "'>" __'Approve' ) . '</a>';
        
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" esc_attr__'Unapprove this comment' ) . "'>" __'Unapprove' ) . '</a>';
        
$actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" esc_attr__('Edit comment') . "'>"__('Edit') . '</a>';
        
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.esc_attr__('Reply to this comment').'" href="#">' __('Reply') . '</a>';
        
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" esc_attr__'Mark this comment as spam' ) . "'>" /* translators: mark as spam link */ _x'Spam''verb' ) . '</a>';
        if ( !
EMPTY_TRASH_DAYS )
            
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" __('Delete Permanently') . '</a>';
        else
            
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" esc_attr__'Move this comment to the trash' ) . "'>" _x('Trash''verb') . '</a>';

        
$actions apply_filters'comment_row_actions'array_filter($actions), $comment );

        
$i 0;
        foreach ( 
$actions as $action => $link ) {
            ++
$i;
            ( ( (
'approve' == $action || 'unapprove' == $action) && === $i ) || === $i ) ? $sep '' $sep ' | ';

            
// Reply and quickedit need a hide-if-no-js span
            
if ( 'reply' == $action || 'quickedit' == $action )
                
$action .= ' hide-if-no-js';

            
$actions_string .= "<span class='$action'>$sep$link</span>";
        }
    }

?>

        <div id="comment-<?php echo $comment->comment_ID?><?php comment_class( array( 'comment-item'wp_get_comment_status($comment->comment_ID) ) ); ?>>
            <?php if ( !$comment->comment_type || 'comment' == $comment->comment_type ) : ?>

            <?php echo get_avatar$comment50 ); ?>

            <div class="dashboard-comment-wrap">
            <h4 class="comment-meta">
                <?php printf/* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */__'From %1$s on %2$s%3$s' ),
                    
'<cite class="comment-author">' get_comment_author_link() . '</cite>'$comment_post_link.' '.$comment_link' <span class="approve">' __'[Pending]' ) . '</span>' ); ?>
            </h4>

            <?php
            
else :
                switch ( 
$comment->comment_type ) :
                case 
'pingback' :
                    
$type __'Pingback' );
                    break;
                case 
'trackback' :
                    
$type __'Trackback' );
                    break;
                default :
                    
$type ucwords$comment->comment_type );
                endswitch;
                
$type esc_html$type );
            
?>
            <div class="dashboard-comment-wrap">
            <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
            <h4 class="comment-meta"><?php printf_x'%1$s on %2$s''dashboard' ), "<strong>$type</strong>"$comment_post_link." ".$comment_link ); ?></h4>
            <p class="comment-author"><?php comment_author_link(); ?></p>

            <?php endif; // comment_type ?>
            <blockquote><p><?php comment_excerpt(); ?></p></blockquote>
            <p class="row-actions"><?php echo $actions_string?></p>
            </div>
        </div>
<?php
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics