WC_Meta_Box_Order_Actions::output()public staticWC 1.0

Output the metabox.

{} It's a method of the class: WC_Meta_Box_Order_Actions{}

Return

null. Nothing.

Usage

$result = WC_Meta_Box_Order_Actions::output( $post );
$post(WP_Post) (required)
Post object.

Code of WC_Meta_Box_Order_Actions::output() WC 6.7.0

<?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.
	// Avoid using this global with the `woocommerce_order_actions` filter, instead use the $order filter arg.
	if ( ! is_object( $theorder ) ) {
		$theorder = wc_get_order( $post->ID );
	}

	$theorder = $theorder instanceof WC_Order ? $theorder : null;
	$order_actions = self::get_available_order_actions_for_order( $theorder );
	?>
	<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
}