Automattic\WooCommerce\Internal\Admin
ShippingLabelBanner::add_meta_boxes()
Add metabox to order page.
Method of the class: ShippingLabelBanner{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ShippingLabelBanner = new ShippingLabelBanner(); $ShippingLabelBanner->add_meta_boxes( $post_type, $post );
- $post_type(string) (required)
- current post type.
- $post(\WP_Post) (required)
- Current post object.
ShippingLabelBanner::add_meta_boxes() ShippingLabelBanner::add meta boxes code WC 8.7.0
public function add_meta_boxes( $post_type, $post ) { if ( 'shop_order' !== $post_type ) { return; } $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' ) ); } }