Skip to content

Commit

Permalink
fix: add missing add_meta_query method in dokan REST API is fixed #788 (
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonh3 committed Mar 4, 2020
1 parent 993bccf commit 75035d9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions includes/Abstracts/DokanRESTController.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,23 @@ public function format_collection_response( $response, $request, $total_items )
return $response;
}

/**
* Add meta query.
*
* @since DOKAN_LITE_SINCE
*
* @param array $args Query args.
* @param array $meta_query Meta query.
*
* @return array
*/
protected function add_meta_query( $args, $meta_query ) {
if ( empty( $args['meta_query'] ) ) {
$args['meta_query'] = array();
}

$args['meta_query'][] = $meta_query;

return $args['meta_query'];
}
}

0 comments on commit 75035d9

Please sign in to comment.