Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes
OrderAttribution::output()
Output the attribution data metabox for the order.
Метод класса: OrderAttribution{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$OrderAttribution = new OrderAttribution(); $OrderAttribution->output( $order );
- $order(WC_Order) (обязательный)
- The order object.
Список изменений
С версии 8.5.0 | Введена. |
Код OrderAttribution::output() OrderAttribution::output WC 9.5.1
public function output( WC_Order $order ) { $meta = $this->filter_meta_data( $order->get_meta_data() ); $this->format_meta_data( $meta ); // No more details if there is only the origin value - this is for unknown source types. $has_more_details = array( 'origin' ) !== array_keys( $meta ); // For direct, web admin, or mobile app orders, also don't show more details. $simple_sources = array( 'typein', 'admin', 'mobile_app' ); if ( isset( $meta['source_type'] ) && in_array( $meta['source_type'], $simple_sources, true ) ) { $has_more_details = false; } $template_data = array( 'meta' => $meta, 'has_more_details' => $has_more_details, ); wc_get_template( 'order/attribution-details.php', $template_data ); }