WC_Admin_Dashboard::status_widget_order_rows()privateWC 1.0

Show order data is status widget.

{} It's a method of the class: WC_Admin_Dashboard{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of WC_Admin_Dashboard::status_widget_order_rows() WC 6.7.0

<?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            = (array) wp_count_posts( $type );
		$on_hold_count    += isset( $counts['wc-on-hold'] ) ? $counts['wc-on-hold'] : 0;
		$processing_count += isset( $counts['wc-processing'] ) ? $counts['wc-processing'] : 0;
	}
	?>
	<li class="processing-orders">
	<a href="<?php echo esc_url( admin_url( 'edit.php?post_status=wc-processing&post_type=shop_order' ) ); ?>">
		<?php
			printf(
				/* translators: %s: order count */
				_n( '<strong>%s order</strong> awaiting processing', '<strong>%s orders</strong> awaiting processing', $processing_count, 'woocommerce' ),
				$processing_count
			); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
		?>
		</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
			printf(
				/* translators: %s: order count */
				_n( '<strong>%s order</strong> on-hold', '<strong>%s orders</strong> on-hold', $on_hold_count, 'woocommerce' ),
				$on_hold_count
			); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
		?>
		</a>
	</li>
	<?php
}