I have few custom comment field - phone, stored as comment meta.
On comments edit page (edit-comments.php) I display this value in custom column. I also display these values on post edit page (post.php) in comments metabox.
To display comment meta values (before comment text) in comments metabox, I use this get_comment_text filter. Inside this function I check if it was called by wp_ajax_get-comments action, because I want to comment meta value as simple text only in comments metabox.
add_filter( 'get_comment_text', function( $comment_comment_content, $comment, $args ){
if( doing_action( 'wp_ajax_get-comments' ) ){
$phone = get_comment_meta( $comment->comment_ID, 'phone', true );
if($phone)
$out .= __('Phone') . ': ' . $phone;
echo $out;
}
return $comment_comment_content;
}, 10, 3 );
But right now comment meta value dissapears after quick update and shows only after page refresh, when wp_ajax_get-comments called again. Here is quick example:
The same problem I have on comments edit page, when I quick update comment - the comment meta value dissapears after quick update.
1) How to update comment text in comments metabox on post edit page after comment quick update?
2) How to update custom columns on comment edit page after comment quick update?