Skip to content

Instantly share code, notes, and snippets.

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

Embed
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.