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 '';
if (count($products) >= $limit) {
$url = admin_url('edit.php?post_status=draft&post_type=product');
echo '';
}
}
}