Skip to content

Instantly share code, notes, and snippets.

@kilbot
Last active September 14, 2018 11:51
Show Gist options
  • Save kilbot/a07e1b98a6f8020646f4f495cbc2863a to your computer and use it in GitHub Desktop.
Save kilbot/a07e1b98a6f8020646f4f495cbc2863a to your computer and use it in GitHub Desktop.
Remove customer meta_data from WC REST API response
<?php
function my_custom_rest_prepare_customer( $response ){
if( function_exists('is_pos') && is_pos() ) {
$data = $response->get_data();
$data['meta_data'] = array(); // remove meta_data
$response->set_data($data);
}
return $response;
}
add_filter( 'woocommerce_rest_prepare_customer', 'my_custom_rest_prepare_customer' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment