如何在订单页面中根据订单id隐藏订单,而不是根据订单状态隐藏订单?
add_action( 'admin_footer', 'admin_dashboard_subscriptions_filter_callback' );
function admin_dashboard_subscriptions_filter_callback() {
global $pagenow, $post_type, $post;
// Targeting subscriptions admin dashboard for specific user role
$order_ids_to_hide = array( 244, 240 );
if ( $pagenow === 'edit.php' && $post_type === 'shop_order' && in_array( $post->ID, $order_ids_to_hide ) ) :
?>
<style>
.post-<?php echo $post->ID; ?> { display: none;}
</style>
<?php
endif;
}