Automattic\WooCommerce\Internal\Admin\Orders

Edit::setup()publicWC 1.0

Setup hooks, actions and variables needed to render order edit page.

{} Это метод класса: Edit{}

Хуки из метода

Возвращает

null. Ничего.

Использование

$Edit = new Edit();
$Edit->setup( $order );
$order(\WC_Order) (обязательный)
Order object.

Код Edit::setup() WC 6.9.1

public function setup( \WC_Order $order ) {
	$this->order    = $order;
	$current_screen = get_current_screen();
	$current_screen->is_block_editor( false );
	$this->screen_id = $current_screen->id;
	if ( ! isset( $this->custom_meta_box ) ) {
		$this->custom_meta_box = wc_get_container()->get( CustomMetaBox::class );
	}
	$this->add_save_meta_boxes();
	$this->handle_order_update();
	$this->add_order_meta_boxes( $this->screen_id, __( 'Order', 'woocommerce' ) );
	$this->add_order_specific_meta_box();

	/**
	 * From wp-admin/includes/meta-boxes.php.
	 *
	 * Fires after all built-in meta boxes have been added. Custom metaboxes may be enqueued here.
	 *
	 * @since 3.8.0.
	 */
	do_action( 'add_meta_boxes', wc_get_page_screen_id( 'shop-order' ), $this->order );
	$this->enqueue_scripts();
}