Have a look at the information on manage_posts_custom_column and manage_posts_column, the same procedure (with minor naming differences) should still apply.
Assumption on my part, but i’d expect it to behave the same as the manage post column functions.
Post back if you still get stuck.. 😉
Thread Starter
BAC
(@bac-1)
Thanks for the reply T31os,
Hit a bit of a brick wall on this.
I tried to start by just getting the value of the commentmeta $myorg into a new column in the edit comments panel but struggling to get it to work.
I would have thought this should work?
function EditCommentsColumnsHeader($columns) {
$columns['myorg'] = __('Org');
return $columns;
}
add_filter( 'manage_comments_column', 'EditCommentsColumnsHeader' );
function EditCommentsColumnsRo($columnTitle, $comment_ID){
if($columnTitle == 'Org'){
echo $myorg;
}
}
add_filter( 'manage_comments_custom_column', 'EditCommentsColumnsRow', 10, 2 );
Am I on the right track?
Cheers
BAC
Looks about right, though there’s a small error in your function name here.
function EditCommentsColumnsRo($columnTitle
Missing the w on the end of the function name.
Hi ,
function EditCommentsColumnsHeader($columns) {
$columns[‘myorg’] = __(‘Org’);
return $columns;
}
add_filter( ‘manage_comments_column’, ‘EditCommentsColumnsHeader’ );
function EditCommentsColumnsRow($columnTitle, $comment_ID){
if($columnTitle == ‘Org’){
echo $myorg;
}
}
add_filter( ‘manage_comments_custom_column’, ‘EditCommentsColumnsRow’, 10, 2 );
this code is not working.
i want to add custom fields on Comment management screen of admin panel and also want to add more fields on edit comment screen after Editor. but unfortunately i cant found any plugin or any action in word press which allow me to do this.
any one know how it possible?
many thanks
JIGAR
the problem is that there isn’t a filter for managing comments column.
There is a action hook in the name of “manage_comments_custom_column”
but there isn’t a filter hook to go with, like “manage_comments_columns”
I’ve looked everywhere for that filter hook… and nothing.
What can be the solution?
Cheers,
Asaf.
I too would like a solution to this. Not found it yet.
// ADD THE COMMENTS META FIELDS TO THE COMMENTS ADMIN PAGE
function comment_meta_row_action( $a ) {
global $comment;
echo '<div class="comment-meta">';
echo get_comment_meta( $comment->comment_ID, 'town', true );
echo '</div>';
return $a;
}
add_filter( 'comment_row_actions', 'comment_meta_row_action', 11, 1 );
Akismet “User X marked this as spam” message is priority 10, so I’ve set this function to 11.
I’ve to admit that I’m not sure exactly what $a does here, but it seems to be essential for a loop that WordPress uses when writing out rows in the comment details.
@adriantoll – that code will add the comment meta data to the main comments list page. I was looking to be able to add the comment meta data to the edit comment form to be able to make the comment meta editable… but last I don’t think this is currently possible.
Ah, yes – apologies for the confusion – this post came up during a search that I was doing for a way to display rather than edit. If there’s no hook I guess the only way would be to write a plugin which enabled you to manage them from a Settings or Tools page – but I’d hope that a hook will be added sometime soon to make this possible in the default comments interface because it seems like a reasonable request to make data stored in commentsmeta editable.