Show notes in order list

This commit is contained in:
Mike Jolley 2017-06-08 12:17:46 +01:00
parent b32d5802b7
commit 75480ab99f
1 changed files with 4 additions and 0 deletions

View File

@ -586,12 +586,16 @@ class WC_Admin_Post_Types {
// check the status of the post // check the status of the post
$status = ( 'trash' !== $post->post_status ) ? '' : 'post-trashed'; $status = ( 'trash' !== $post->post_status ) ? '' : 'post-trashed';
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$latest_notes = get_comments( array( $latest_notes = get_comments( array(
'post_id' => $post->ID, 'post_id' => $post->ID,
'number' => 1, 'number' => 1,
'status' => $status, 'status' => $status,
) ); ) );
add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
$latest_note = current( $latest_notes ); $latest_note = current( $latest_notes );
if ( isset( $latest_note->comment_content ) && 1 == $post->comment_count ) { if ( isset( $latest_note->comment_content ) && 1 == $post->comment_count ) {