Only display attribution meta boxes for valid orders

This commit is contained in:
Justin Palmer 2023-11-13 14:44:56 +01:00
parent c4ec613277
commit 7c1d6b6d7c
No known key found for this signature in database
GPG Key ID: ACAB7C35AA2577AF
1 changed files with 6 additions and 2 deletions

View File

@ -241,7 +241,9 @@ class Edit {
sprintf( __( '%s information', 'woocommerce' ), $title ),
function( $post_or_order ) use ( $source_attribution_meta_box ) {
$order = $post_or_order instanceof WC_Order ? $post_or_order : wc_get_order( $post_or_order );
if ( $order instanceof WC_Order ) {
$source_attribution_meta_box->output( $order );
}
},
$screen_id,
'side',
@ -260,7 +262,9 @@ class Edit {
__( 'Customer History', 'woocommerce' ),
function( $post_or_order ) use ( $customer_history_meta_box ) {
$order = $post_or_order instanceof WC_Order ? $post_or_order : wc_get_order( $post_or_order );
if ( $order instanceof WC_Order ) {
$customer_history_meta_box->output( $order );
}
},
$screen_id,
'side',