shop order - fixes non object error on comments when order is in the trash
This commit is contained in:
parent
8b8fe715b6
commit
5d96b666f1
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue