Automattic\WooCommerce\Internal\Admin\Orders

Edit::render_wrapper_start()privateWC 1.0

Helper function to render wrapper start.

Method of the class: Edit{}

Hooks from the method

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->render_wrapper_start( $notice, $message );
$notice(string)
Notice to display, if any.
Default: ''
$message(string)
Message to display, if any.
Default: ''

Edit::render_wrapper_start() code WC 7.1.1

<?php
private function render_wrapper_start( $notice = '', $message = '' ) {
	$edit_page_url = admin_url( 'admin.php?page=wc-orders&action=edit&id=' . $this->order->get_id() );
	$form_action   = 'edit_order';
	$referer       = wp_get_referer();
	$new_page_url  = wc_get_container()->get( PageController::class )->get_new_page_url();

	?>
	<div class="wrap">
	<h1 class="wp-heading-inline">
		<?php echo esc_html( 'Edit order' ); ?>
	</h1>
	<?php
	echo ' <a href="' . esc_url( $new_page_url ) . '" class="page-title-action"> Add order </a>';
	?>
	<hr class="wp-header-end">

	<?php
	if ( $notice ) :
		?>
		<div id="notice" class="notice notice-warning"><p
				id="has-newer-autosave"><?php echo wp_kses_post( $notice ); ?></p></div>
	<?php endif; ?>
	<?php if ( $message ) : ?>
		<div id="message" class="updated notice notice-success is-dismissible">
			<p><?php echo wp_kses_post( $message ); ?></p></div>
		<?php
		endif;
	?>

	<form name="order" action="<?php echo esc_url( $edit_page_url ); ?>" method="post" id="order"
	<?php
	/**
	 * Fires inside the order edit form tag.
	 *
	 * @param \WC_Order $order Order object.
	 *
	 * @since 6.9.0
	 */
	do_action( 'order_edit_form_tag', $this->order );
	?>
	>
	<?php wp_nonce_field( $this->get_order_edit_nonce_action() ); ?>
	<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>"/>
	<input type="hidden" id="original_order_status" name="original_order_status" value="<?php echo esc_attr( $this->order->get_status() ); ?>"/>
	<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>"/>
	<div id="poststuff">
	<div id="post-body"
	class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>">
	<?php
}