Automattic\WooCommerce\Admin\Features
ShippingLabelBanner::add_meta_boxes() public WC 1.0
Add metabox to order page.
{} Это метод класса: ShippingLabelBanner{}
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
$ShippingLabelBanner = new ShippingLabelBanner(); $ShippingLabelBanner->add_meta_boxes( $post_type, $post );
- $post_type(строка) (обязательный)
- current post type.
- $post(\WP_Post) (обязательный)
- Current post object.
Код ShippingLabelBanner::add_meta_boxes() ShippingLabelBanner::add meta boxes WC 5.2.1
public function add_meta_boxes( $post_type, $post ) {
$order = wc_get_order( $post );
if ( $this->should_show_meta_box() ) {
add_meta_box(
'woocommerce-admin-print-label',
__( 'Shipping Label', 'woocommerce' ),
array( $this, 'meta_box' ),
null,
'normal',
'high',
array(
'context' => 'shipping_label',
'order' => $post->ID,
'items' => $this->count_shippable_items( $order ),
)
);
add_action( 'admin_enqueue_scripts', array( $this, 'add_print_shipping_label_script' ) );
}
}