Ecommerce Shopify WordPress Discussion

WordPress – admin_url filter causing redirects loop

I'm using this two filter in my wordpress plugin add_filter('login_url', array($this, 'custom_login_url'), 10, 2); add_filter('admin_url', array($this, 'custom_admin_url'), 10, 2); I want to set a custom login url and a custon url for wp-admin. I've a problem with the admin_url, I'm facing a too many redirect error and now I'm unable to access to the dashboard so I will deactivate the plugin manually. The code of the two function called from the filters are these public function custom_login_url($login_url, $redirect) { $custom_login_url = get_option('custom_login_url'); return !empty($custom_login_url) ? $custom_login_url : $login_url; } public function custom_admin_url($admin_url, $path) { $custom_admin_url = get_option('custom_admin_url'); return !empty($custom_admin_url) ? $custom_admin_url : $admin_url; } Any help please?
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.