Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
duy

Show comment category column

Hi team,

I want to show column Category of post in comment backend (edit-comments.php) with filter function. How to do it?

Thanks

5 years, 10 months ago
Stefan van den Dungen Gronovius
Developer

Hello,

I would not recommend using a filter for this, since there is not really a column where altering the value would make sens. There is of course the Post column for comments, where you can choose whether to display the title or other Post properties, but not the Category. Using a filter here would give you unexpected behavior.

Instead, I would recommend creating your own column by using our documentation and toolkit.

Creating a new column type

Of course, this would only apply to you if you’re a developer. Creating the filtering feature for this column would be a bit more difficult since you have to write your own Join statements in the WP_Query. This is because you’re trying to filter on a relational post data when you’re on our comment, and this functionality is not really supported by our plugin out of the box.

I created a column that will display the product category in our unofficial plugin ‘Experimental Columns’ which can be downloaded and installed from here: https://github.com/codepress/ac-addon-extra-columns

Please notice that this plugin contains multiple experimental columns and is mainly meant as example plugin for creating your own columns.

5 years, 10 months ago

You must be logged in to reply to this topic.