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 committed by Coen Jacobs
parent 8b8fe715b6
commit 5d96b666f1
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 ) { if ( $post->comment_count ) {
// check the status of the post
( $post->post_status !== 'trash' ) ? $status = '' : $status = 'post-trashed';
$latest_notes = get_comments( array( $latest_notes = get_comments( array(
'post_id' => $post->ID, 'post_id' => $post->ID,
'number' => 1 'number' => 1,
'status' => $status
) ); ) );
$latest_note = current( $latest_notes ); $latest_note = current( $latest_notes );