shop order - fixes non object error on comments when order is in the trash

This commit is contained in:
splashingpixels 2014-02-28 22:08:42 -08:00
parent 6fcdccd73b
commit d357154d2f
1 changed files with 6 additions and 2 deletions

View File

@ -193,9 +193,13 @@ class WC_Admin_CPT_Shop_Order extends WC_Admin_CPT {
if ( $post->comment_count ) {
// check the status of the post
( $post->post_status !== 'trash' ) ? $status = '' : $status = 'post-trashed';
$latest_notes = get_comments( array(
'post_id' => $post->ID,
'number' => 1
'post_id' => $post->ID,
'number' => 1,
'status' => $status
) );
$latest_note = current( $latest_notes );