WC_Admin_Dashboard::status_widget_order_rowsprivateWC 1.0

Show order data is status widget.

Method of the class: WC_Admin_Dashboard{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->status_widget_order_rows();

WC_Admin_Dashboard::status_widget_order_rows() code WC 11.0.1

<?php
private function status_widget_order_rows() {
	if ( ! current_user_can( 'edit_shop_orders' ) ) {
		return;
	}
	$on_hold_count    = 0;
	$processing_count = 0;

	foreach ( wc_get_order_types( 'order-count' ) as $type ) {
		$counts            = OrderUtil::get_count_for_type( $type );
		$on_hold_count    += $counts[ OrderInternalStatus::ON_HOLD ];
		$processing_count += $counts[ OrderInternalStatus::PROCESSING ];
	}
	?>
	<li class="processing-orders">
	<a href="<?php echo esc_url( admin_url( 'edit.php?post_status=wc-processing&post_type=shop_order' ) ); ?>">
		<?php
			echo wp_kses_post(
				sprintf(
					/* translators: %s: order count */
					_n( 'Awaiting processing <strong>%s order</strong>', 'Awaiting processing <strong>%s orders</strong>', $processing_count, 'woocommerce' ),
					$processing_count
				)
			);
		?>
		</a>
	</li>
	<li class="on-hold-orders">
		<a href="<?php echo esc_url( admin_url( 'edit.php?post_status=wc-on-hold&post_type=shop_order' ) ); ?>">
		<?php
			echo wp_kses_post(
				sprintf(
					/* translators: %s: order count */
					_n( 'On-hold <strong>%s order</strong>', 'On-hold <strong>%s orders</strong>', $on_hold_count, 'woocommerce' ),
					$on_hold_count
				)
			);
		?>
		</a>
	</li>
	<?php
}