fix: Add settings submenu to backend NavigationRegistry (single source of truth)
This commit is contained in:
@@ -156,11 +156,40 @@ class NavigationRegistry {
|
||||
'label' => __('Settings', 'woonoow'),
|
||||
'path' => '/settings',
|
||||
'icon' => 'settings',
|
||||
'children' => [], // Settings children will be added by SettingsProvider
|
||||
'children' => self::get_settings_children(),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get settings submenu children
|
||||
*
|
||||
* @return array Settings submenu items
|
||||
*/
|
||||
private static function get_settings_children(): array {
|
||||
$admin = admin_url('admin.php');
|
||||
|
||||
return [
|
||||
// WooNooW Settings
|
||||
['label' => __('WooNooW', 'woonoow'), 'mode' => 'spa', 'path' => '/settings'],
|
||||
|
||||
// WooCommerce Settings (Most Used First)
|
||||
['label' => __('General', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/general'],
|
||||
['label' => __('Payments', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/payments'],
|
||||
['label' => __('Shipping', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/shipping'],
|
||||
['label' => __('Products', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/products'],
|
||||
['label' => __('Tax', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/tax'],
|
||||
['label' => __('Accounts & Privacy', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/accounts'],
|
||||
['label' => __('Emails', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/emails'],
|
||||
|
||||
// Less Common (Bridge to WP Admin for now)
|
||||
['label' => __('Advanced', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=advanced'],
|
||||
['label' => __('Integration', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=integration'],
|
||||
['label' => __('Status', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-status'],
|
||||
['label' => __('Extensions', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-addons'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the complete navigation tree
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user