Skip to content

Commit

Permalink
avoid multiple unset calls
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Feb 6, 2024
1 parent 715efe6 commit c054a28
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,15 @@ public function get_collection_params() {
$query_params = parent::get_collection_params();

// Remove unneeded params.
unset( $query_params['after'] );
unset( $query_params['modified_after'] );
unset( $query_params['before'] );
unset( $query_params['modified_before'] );
unset( $query_params['search'] );
unset( $query_params['search_columns'] );
unset( $query_params['status'] );
unset(
$query_params['after'],
$query_params['modified_after'],
$query_params['before'],
$query_params['modified_before'],
$query_params['search'],
$query_params['search_columns'],
$query_params['status']
);

$query_params['orderby']['default'] = 'id';
$query_params['orderby']['enum'] = array( 'id', 'include' );
Expand Down

0 comments on commit c054a28

Please sign in to comment.