WooCommerce get_author_posts_url() – Author URL redirecting to shop base

Question

I’ve noticed that when I have WooCommerce enabled and use get_author_posts_url() it automatically redirects to the ‘shop base’ when the user’s role is Customer.

When I change the user to Subscriber get_author_posts_url() works correctly.

I’ve disabled all plugins to systematically identify what was causing the issue and can confirm that it’s only when WooCommerce is enabled. I’ve also flushed rewrites. I’ve also even tried using $user->add_role( 'subscriber' ) to the user’s capabability array.

Does anyone know why this is happening and how I can suppress it? (i.e. don’t redirect get_author_posts_url() for users with a customer role.

EDIT

I believe this to be a bug, I’ve opened a bug ticket with WC and have posted on the WP forum thread

For now I’ve just set all ‘customer’ users to ‘subscribers’ when I get a reply/make any headway I will post back here.

Thanks in advance!

0
Ryan Dorn 4 months 0 Answers 20 views 0

Leave an answer