WC_Admin_Dashboard::network_orders()publicWC 1.0

Network orders widget.

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

Хуков нет.

Возвращает

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

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

$WC_Admin_Dashboard = new WC_Admin_Dashboard();
$WC_Admin_Dashboard->network_orders();

Код WC_Admin_Dashboard::network_orders() WC 9.3.3

<?php
public function network_orders() {
	$suffix  = Constants::is_true( 'SCRIPT_DEBUG' ) ? '' : '.min';
	$version = Constants::get_constant( 'WC_VERSION' );

	wp_enqueue_style( 'wc-network-orders', WC()->plugin_url() . '/assets/css/network-order-widget.css', array(), $version );

	wp_enqueue_script( 'wc-network-orders', WC()->plugin_url() . '/assets/js/admin/network-orders' . $suffix . '.js', array( 'jquery', 'underscore' ), $version, true );

	$user     = wp_get_current_user();
	$blogs    = get_blogs_of_user( $user->ID );
	$blog_ids = wp_list_pluck( $blogs, 'userblog_id' );

	wp_localize_script(
		'wc-network-orders',
		'woocommerce_network_orders',
		array(
			'nonce'          => wp_create_nonce( 'wp_rest' ),
			'sites'          => array_values( $blog_ids ),
			'order_endpoint' => get_rest_url( null, 'wc/v3/orders/network' ),
		)
	);
	?>
	<div class="post-type-shop_order">
	<div id="woocommerce-network-order-table-loading" class="woocommerce-network-order-table-loading is-active">
		<p>
			<span class="spinner is-active"></span> <?php esc_html_e( 'Loading network orders', 'woocommerce' ); ?>
		</p>

	</div>
	<table id="woocommerce-network-order-table" class="woocommerce-network-order-table">
		<thead>
			<tr>
				<td><?php esc_html_e( 'Order', 'woocommerce' ); ?></td>
				<td><?php esc_html_e( 'Status', 'woocommerce' ); ?></td>
				<td><?php esc_html_e( 'Total', 'woocommerce' ); ?></td>
			</tr>
		</thead>
		<tbody id="network-orders-tbody">

		</tbody>
	</table>
	<div id="woocommerce-network-orders-no-orders" class="woocommerce-network-orders-no-orders">
		<p>
			<?php esc_html_e( 'No orders found', 'woocommerce' ); ?>
		</p>
	</div>
	<?php // @codingStandardsIgnoreStart ?>
	<script type="text/template" id="network-orders-row-template">
		<tr>
			<td>
				<a href="<%- edit_url %>" class="order-view"><strong>#<%- number %> <%- customer %></strong></a>
				<br>
				<em>
					<%- blog.blogname %>
				</em>
			</td>
			<td>
				<mark class="order-status status-<%- status %>"><span><%- status_name %></span></mark>
			</td>
			<td>
				<%= formatted_total %>
			</td>
		</tr>
	</script>
	<?php // @codingStandardsIgnoreEnd ?>
</div>
	<?php
}