add_action( 'manage_shop_order_posts_custom_column' , 'custom_orders_list_column_content', 50, 2 );
function custom_orders_list_column_content( $column, $post_id ) {
if ( $column == 'order_number' )
{
global $the_order;
if( $phone = $the_order->get_billing_phone() ){
$phone_wp_dashicon = '<span class="dashicons dashicons-phone"></span> ';
echo '<br><a href="tel:'.$phone.'">' . $phone_wp_dashicon . $phone.'</a></strong>';
}
if( $email = $the_order->get_billing_email() ){
echo '<br><strong><a href="mailto:'.$email.'">' . $email . '</a></strong>';
}
}
}
所以,这是我遇到的问题。我有两个场景,它显示了第一个场景的现金余额(0 +现金),但是对于第二个场景,它始终响应错误:
NullReferenceException:对象引用未设置为对象MainCode.Update()的实例(位于Assets / MainCode.cs:24)