[wp-hackers] Extending comment filter in comments admin

Ravi Narayan Sarma ravi-lists at g8o.net
Fri Dec 25 00:06:45 UTC 2009


Hello all,

so I have been struggling along with my “comment response tracker” plugin; the plan is: in the comments admin page (edit-comments.php) I offer a few options to let the user mark a comment as “todo”, “replied” or “ignore”. Comments that are “todo” are displayed with some sort of background colouring. Also, the current response status is highlighted among the three choices. That’s all been hacked up to the best of my abilities.

Now, I figured, wouldn’t it be sweet to let the user “Filter” comments by the response status? Turns out there is a convenient hook “admin_comment_types_dropdown” that lets me extend the filter options offered to the user. The current set of options (“Comments”, “Pings”) is passed down to me and I add in “Todo”, “Replied”, “Ignored” to this list. So far so good. But the next step has me stymied. It seems that _wp_get_comment_list() is where the the status criteria is applied, but there seems to be no hook to influence this process. But then, why would there be an “admin_comment_types_dropdown” hook? Perhaps I am looking in the wrong place.

Well, how about another direction… also available is a “manage_comments_nav” action to extend this menu. Akismet uses this to add a “Check for Spam” button. Should I perhaps be following suit, and extend the menu to offer my filtering options, rather than extend the Filter options?

Any suggestions would help alleviate my OCD!

	— ravi



More information about the wp-hackers mailing list