WC_Meta_Box_Order_Actions::output( WP_Post $post )
Output the metabox.
Description Description
Parameters Parameters
- $post
-
(Required) Post object.
Source Source
File: includes/admin/meta-boxes/class-wc-meta-box-order-actions.php
public static function output( $post ) {
global $theorder;
// This is used by some callbacks attached to hooks such as woocommerce_order_actions which rely on the global to determine if actions should be displayed for certain orders.
if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $post->ID );
}
$order_actions = apply_filters(
'woocommerce_order_actions',
array(
'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ),
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
)
);
?>
<ul class="order_actions submitbox">
<?php do_action( 'woocommerce_order_actions_start', $post->ID ); ?>
<li class="wide" id="actions">
<select name="wc_order_action">
<option value=""><?php esc_html_e( 'Choose an action...', 'woocommerce' ); ?></option>
<?php foreach ( $order_actions as $action => $title ) { ?>
<option value="<?php echo esc_attr( $action ); ?>"><?php echo esc_html( $title ); ?></option>
<?php } ?>
</select>
<button class="button wc-reload"><span><?php esc_html_e( 'Apply', 'woocommerce' ); ?></span></button>
</li>
<li class="wide">
<div id="delete-action">
<?php
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( ! EMPTY_TRASH_DAYS ) {
$delete_text = __( 'Delete permanently', 'woocommerce' );
} else {
$delete_text = __( 'Move to Trash', 'woocommerce' );
}
?>
<a class="submitdelete deletion" href="<?php echo esc_url( get_delete_post_link( $post->ID ) ); ?>"><?php echo esc_html( $delete_text ); ?></a>
<?php
}
?>
</div>
<button type="submit" class="button save_order button-primary" name="save" value="<?php echo 'auto-draft' === $post->post_status ? esc_attr__( 'Create', 'woocommerce' ) : esc_attr__( 'Update', 'woocommerce' ); ?>"><?php echo 'auto-draft' === $post->post_status ? esc_html__( 'Create', 'woocommerce' ) : esc_html__( 'Update', 'woocommerce' ); ?></button>
</li>
<?php do_action( 'woocommerce_order_actions_end', $post->ID ); ?>
</ul>
<?php
}