Last active
September 14, 2018 11:51
-
-
Save kilbot/a07e1b98a6f8020646f4f495cbc2863a to your computer and use it in GitHub Desktop.
Remove customer meta_data from WC REST API response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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