WC_REST_Paypal_Standard_Controller::decode_meta_values
Helper method to support recursively ensuring metadata string values are decoded.
Method of the class: WC_REST_Paypal_Standard_Controller{}
No Hooks.
Returns
array. The decoded metadata value array.
Usage
// private - for code of main (parent) class only $result = $this->decode_meta_values( $meta_value_array, $blog_charset ): array;
- $meta_value_array(array) (required)
- The metadata value array.
- $blog_charset(string) (required)
- The blog charset.
WC_REST_Paypal_Standard_Controller::decode_meta_values() WC REST Paypal Standard Controller::decode meta values code WC 11.3.0
private function decode_meta_values( array $meta_value_array, string $blog_charset ): array {
$decoded_values = array();
foreach ( $meta_value_array as $key => $value ) {
if ( is_string( $value ) ) {
$decoded_values[ $key ] = html_entity_decode( $value, ENT_QUOTES, $blog_charset );
} elseif ( is_array( $value ) ) {
$decoded_values[ $key ] = $this->decode_meta_values( $value, $blog_charset );
} elseif ( is_scalar( $value ) ) {
$decoded_values[ $key ] = $value;
}
}
return $decoded_values;
}