Merge pull request #5005 from splashingpixels/shop-order

shop order - fixes non object error on comments when order is in the tra...
This commit is contained in:
Mike Jolley 2014-03-03 10:43:33 +00:00
commit c989ebd967
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
'number' => 1,
'status' => $status
) );
$latest_note = current( $latest_notes );