Implemented more general filter array

This commit is contained in:
Florian Ludwig 2014-08-23 00:11:03 +02:00 committed by Ninos Ego
parent bf8b999a80
commit 1cc8ae0b64
1 changed files with 5 additions and 3 deletions

View File

@ -119,10 +119,10 @@ class WC_API_Orders extends WC_API_Resource {
* @since 2.1
* @param int $id the order ID
* @param array $fields
* @param string $meta_hideprefix
* @param array $filter
* @return array
*/
public function get_order( $id, $fields = null, $meta_hideprefix = '_' ) {
public function get_order( $id, $fields = null, $filter = array() ) {
// ensure order ID is valid & user has permission to read
$id = $this->validate_request( $id, 'shop_order', 'read' );
@ -203,7 +203,9 @@ class WC_API_Orders extends WC_API_Resource {
$item_meta = array();
foreach ( $meta->get_formatted($meta_hideprefix) as $meta_key => $formatted_meta ) {
$hideprefix = $filter['all_meta'] == true ? null : '_';
foreach ( $meta->get_formatted( $hideprefix ) as $meta_key => $formatted_meta ) {
$item_meta[] = array(
'key' => $meta_key,
'label' => $formatted_meta['label'],