Last active
December 22, 2025 07:01
-
-
Save aimahdi/eb78ee6c880b933a82884957ebd061d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('fluent_cart/global_customer_menu_items', function ($items, $context) { | |
| unset($items['downloads']); | |
| return $items; | |
| }, 10, 2); | |
| add_action('template_redirect', function () { | |
| if (is_admin()) { | |
| return; | |
| } | |
| $slug = ''; | |
| if (class_exists('\FluentCart\Api\StoreSettings')) { | |
| $slug = (new \FluentCart\Api\StoreSettings())->getCustomerDashboardPageSlug(); | |
| } | |
| if (!$slug) { | |
| return; | |
| } | |
| global $wp; | |
| $requested = trim($wp->request, '/'); | |
| if ($requested === $slug . '/downloads' || $requested === $slug . '/downloads/') { | |
| wp_safe_redirect(home_url("/{$slug}/"), 301); | |
| exit; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment