Automattic\WooCommerce\Internal\Admin\Orders

ListTable::display()publicWC 1.0

Render the table.

Метод класса: ListTable{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$ListTable = new ListTable();
$ListTable->display();

Код ListTable::display() WC 9.3.3

public function display() {
	$post_type = get_post_type_object( $this->order_type );

	$title         = esc_html( $post_type->labels->name );
	$add_new       = esc_html( $post_type->labels->add_new );
	$new_page_link = $this->page_controller->get_new_page_url( $this->order_type );
	$search_label  = '';

	if ( ! empty( $this->order_query_args['s'] ) ) {
		$search_label  = '<span class="subtitle">';
		$search_label .= sprintf(
			/* translators: %s: Search query. */
			__( 'Search results for: %s', 'woocommerce' ),
			'<strong>' . esc_html( $this->order_query_args['s'] ) . '</strong>'
		);
		$search_label .= '</span>';
	}

	// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	echo wp_kses_post(
		"
		<div class='wrap'>
			<h1 class='wp-heading-inline'>{$title}</h1>
			<a href='" . esc_url( $new_page_link ) . "' class='page-title-action'>{$add_new}</a>
			{$search_label}
			<hr class='wp-header-end'>"
	);

	if ( $this->should_render_blank_state() ) {
		$this->render_blank_state();
		return;
	}

	$this->views();

	echo '<form id="wc-orders-filter" method="get" action="' . esc_url( get_admin_url( null, 'admin.php' ) ) . '">';
	$this->print_hidden_form_fields();
	$this->search_box( esc_html__( 'Search orders', 'woocommerce' ), 'orders-search-input' );

	parent::display();
	echo '</form> </div>';
}