No permission to manage products.'; return; } if (!class_exists('WooCommerce')) { echo '
WooCommerce plugin not active.
'; return; } $limit = 5; $args = [ 'status' => 'draft', 'limit' => $limit, 'orderby' => 'date', 'order' => 'DESC', ]; $products = wc_get_products($args); if (!$products) { echo '
No product in draft status.
'; return; } echo ''; echo ''; foreach ($products as $product) { $name = $product->get_name(); $name = strlen($name) > 28 ? substr($name, 0, 28) . '...' : $name; $url = get_edit_post_link($product->get_id()); echo '' . '' . ''; } echo '
Products
' . esc_html($name) . '
'; if (count($products) >= $limit) { $url = admin_url('edit.php?post_status=draft&post_type=product'); echo '
' . '
+ more
' . '
See all
' . '
'; } } }