Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes
OrderAttribution::format_meta_data
Format the meta data for display.
Method of the class: OrderAttribution{}
No Hooks.
Returns
null. Nothing (null).
Usage
$OrderAttribution = new OrderAttribution(); $OrderAttribution->format_meta_data( $meta );
- $meta(array) (required)
- The array of meta data to format.
Changelog
| Since 8.5.0 | Introduced. |
OrderAttribution::format_meta_data() OrderAttribution::format meta data code WC 10.3.5
public function format_meta_data( array &$meta ) {
if ( array_key_exists( 'device_type', $meta ) ) {
switch ( $meta['device_type'] ) {
case 'Mobile':
$meta['device_type'] = __( 'Mobile', 'woocommerce' );
break;
case 'Tablet':
$meta['device_type'] = __( 'Tablet', 'woocommerce' );
break;
case 'Desktop':
$meta['device_type'] = __( 'Desktop', 'woocommerce' );
break;
default:
$meta['device_type'] = __( 'Unknown', 'woocommerce' );
break;
}
}
}