No permission to manage orders.'; return; } if (!class_exists('WooCommerce')) { echo '
WooCommerce plugin not active.
'; return; } $limit = 5; $args = [ 'status' => 'on-hold', 'limit' => $limit, 'orderby' => 'date', 'order' => 'DESC', ]; $orders = wc_get_orders($args); if (!$orders) { echo '
No orders in on-hold status.
'; return; } echo ''; echo ''; $formatDate = get_option('date_format'); foreach ($orders as $order) { $orderId = $order->get_id(); $customer = trim($order->get_formatted_billing_full_name()); $customer = strlen($customer) > 20 ? substr($customer, 0, 20) . '...' : $customer; $date = wp_date($formatDate, $order->get_date_created()->getTimestamp()); $url = admin_url('admin.php?page=wc-orders&action=edit&id=' . intval($orderId)); echo '' . '' . '' . '' . ''; } echo '
DateOrderNumCustomer
' . esc_html($date) . '#' . intval($orderId) . '' . esc_html($customer) . '
'; if (count($orders) >= $limit) { $url = admin_url('admin.php?page=wc-orders&status=wc-on-hold'); echo '
' . '
+ more
' . '
See all
' . '
'; } } }