Add paginate
This commit is contained in:
parent
11c7722eff
commit
0721354ff2
|
@ -229,6 +229,7 @@ class WC_Data_Store_WP {
|
|||
'limit' => 'posts_per_page',
|
||||
'type' => 'post_type',
|
||||
'return' => 'fields',
|
||||
'paginate' => 'no_found_rows',
|
||||
);
|
||||
|
||||
if ( isset( $key_mapping[ $key ] ) ) {
|
||||
|
|
|
@ -738,10 +738,10 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
public function query( $query_vars ) {
|
||||
$args = $this->get_wp_query_args( $query_vars );
|
||||
$query = new WP_Query( $args );
|
||||
|
||||
if ( isset( $query_vars['return'] ) && 'ids' === $query_vars['return'] ) {
|
||||
return $query->posts;
|
||||
}
|
||||
// paged?
|
||||
return array_map( 'wc_get_order', $query->posts );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue