Singular_Order_Page::add_meta_boxes( string $post_type, WP_Post $post )
Adds the metaboxes to the order post type.
Contents
Parameters
- $post_type
-
(string) (Required) The post type.
- $post
-
(WP_Post) (Required) The post object.
Return
(void)
Source
File: src/Tickets/Commerce/Admin/Singular_Order_Page.php
public function add_meta_boxes( $post_type, $post ): void {
if ( Order::POSTTYPE !== $post_type ) {
return;
}
add_meta_box(
'tribe-tickets-order-details',
__( 'Order Details', 'event-tickets' ),
[ $this, 'render_order_details' ],
$post_type,
'normal',
'high'
);
add_meta_box(
'tribe-tickets-order-items',
__( 'Items', 'event-tickets' ),
[ $this, 'render_order_items' ],
$post_type,
'normal',
'high'
);
global $wp_meta_boxes;
$meta_box = $wp_meta_boxes[ get_current_screen()->id ]['side']['core']['submitdiv'] ?? false;
// Remove core's Publish metabox and add our own.
remove_meta_box( 'submitdiv', $post_type, 'side' );
add_meta_box(
'submitdiv',
__( 'Actions', 'event-tickets' ),
[ $this, 'render_actions' ],
$post_type,
'side',
'high',
$meta_box['args'] ?? []
);
}
Changelog
| Version | Description |
|---|---|
| 5.13.3 | Introduced. |