Don’t bump – you only waited 9 minutes…
You cannot do this, but you can filter by order status. Use the links at the top of the order screen.
i’ve done this
add_filter( 'manage_edit-shop_order_sortable_columns', 'my_sortable_shop_order_column' );
function my_sortable_shop_order_column( $columns ) {
$columns['payment_status'] = 'payment_status';
return $columns;
}
add_action( 'pre_get_posts', 'my_slice_orderby' );
function my_slice_orderby( $query ) {
if( ! is_admin() )
return;
$orderby = $query->get( 'orderby');
if( 'payment_status' == $orderby ) {
$query->set('meta_key','_custom_payment_status');
$query->set('orderby','meta_value_num');
}
}
It did sort without skipping paid but can it be done on runtime.
A filter is still better – doing it this way will make the request/page load slower.
Thanks, but can it be done on runtime because right now i’ve to click for sorting.