Skip to content

Instantly share code, notes, and snippets.

@kurozumi kurozumi/functions.php
Last active Aug 29, 2015

What would you like to do?
add_filter("post_row_actions", function($actions, $post){
if($post->post_status == "publish"){
$num_comments = wp_count_comments($post->ID);
$actions['spam'] = sprintf('<a href="%s">' . __('Spam') . '(%s)</a>', sprintf(admin_url('edit-comments.php?comment_status=spam&p=%d'), $post->ID), $num_comments->spam);
return $actions;
}, 0, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.