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

@@ -146,6 +146,15 @@ add_action('admin_menu', function() use ($adminController) {
[$adminController, 'addRulePage']
);
add_submenu_page(
'sodino-dashboard',
__('قالب‌های آماده', 'sodino'),
__('قالب‌های آماده', 'sodino'),
'manage_options',
'sodino-templates',
[$adminController, 'templatesPage']
);
add_submenu_page(
'sodino-dashboard',
__('آپسل (پیشنهاد فروش)', 'sodino'),
@@ -247,8 +256,8 @@ add_action('admin_enqueue_scripts', function($hook) {
* Handle admin actions
*/
add_action('admin_init', function() use ($ruleController, $settingsController, $adminController) {
$page = $_GET['page'] ?? '';
$action = $_GET['action'] ?? '';
$page = isset($_GET['page']) ? sanitize_key(wp_unslash($_GET['page'])) : '';
$action = isset($_GET['action']) ? sanitize_key(wp_unslash($_GET['action'])) : '';
// Rule actions
if ($page === 'sodino-rules' && $action === 'delete') {