feat(Core): add optimize and complete code

This commit is contained in:
2026-05-17 20:05:15 +03:30
parent aa944bf339
commit 4e60b7efdd
25 changed files with 858 additions and 54 deletions

View File

@@ -85,6 +85,9 @@ class Sodino_Rules_List_Table extends WP_List_Table {
'cart_contains_category' => __('سبد شامل دسته‌بندی', 'sodino'),
'customer_order_count_min' => __('حداقل سفارش مشتری', 'sodino'),
'customer_order_count_max' => __('حداکثر سفارش مشتری', 'sodino'),
'customer_days_since_last_order_min' => __('حداقل روز از آخرین سفارش', 'sodino'),
'product_total_sales_max' => __('حداکثر فروش کل محصول', 'sodino'),
'product_total_sales_min' => __('حداقل فروش کل محصول', 'sodino'),
'day_of_week' => __('روز هفته', 'sodino'),
];
}
@@ -171,6 +174,10 @@ class Sodino_Rules_List_Table extends WP_List_Table {
public function process_bulk_action() {
if ('delete' === $this->current_action()) {
if (!current_user_can('manage_options')) {
return;
}
$rule_ids = isset($_POST['rule_ids']) ? array_map('intval', $_POST['rule_ids']) : [];
if (!empty($rule_ids) && check_admin_referer('bulk-' . $this->_args['plural'])) {
foreach ($rule_ids as $id) {