Quantcast
Channel: Question and Answer » default
Viewing all articles
Browse latest Browse all 17

set custom value on default admin columns based on row values

$
0
0

I added some foreign key to wp_comments db table. Some comments could be indipendent from post. For these comments I’ve comment_post_ID set to 0. So i need something like:

add_filter("manage_comments_default_column","myplugin_my_filter", 10, 2);

function myplugin_my_filter($default, $comment_ID){
     if($default == "response"){
         //and if comment with id=$comment_ID isn't related to a post
         echo "";
     }
}

Does exist some similar hook?

—Edit—

Temporary solved using:

/*
unlink 'response' column and  add a 'response' 
substitute column called 'article'
*/
add_filter("manage_edit-comments_columns", "myplugin_manage-columns");

/*
  if comment has a post related show a link to 
  that post in 'article' field 
  else leave 'article' field empty
*/
add_filter("manage_comments_custom_column","myplugin_manage-content-columns", 10, 2);

But I hope for a better solution.



Viewing all articles
Browse latest Browse all 17

Trending Articles