Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes
OrderAttribution::format_meta_data
Format the meta data for display.
Метод класса: OrderAttribution{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$OrderAttribution = new OrderAttribution(); $OrderAttribution->format_meta_data( $meta );
- $meta(массив) (обязательный)
- The array of meta data to format.
Список изменений
| С версии 8.5.0 | Введена. |
Код OrderAttribution::format_meta_data() OrderAttribution::format meta data 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;
}
}
}