Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Cannot Access Post Type Archive Page Due To Redirect #298

Open
crgeary opened this issue Feb 14, 2018 · 1 comment
Open

Cannot Access Post Type Archive Page Due To Redirect #298

crgeary opened this issue Feb 14, 2018 · 1 comment

Comments

@crgeary
Copy link

crgeary commented Feb 14, 2018

When creating a custom post type called team, which has a custom post type archive page with a slug of team, the custom area plugin redirects you to the customer-area/dashboard page. It's not possible to access the post type archive page.

Steps

  1. Create a post type called team
  2. Make it public, and set has_archive => true
  3. Clear permalinks
  4. Attempt to access /team/

Backtrace

require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, CUAR_AbstractPageAddOn->redirect_guests_if_required, CUAR_Plugin->login_then_redirect_to_page, CUAR_Plugin->login_then_redirect_to_url, wp_redirect

Possible Fix

Check with the queried object id against $this->get_page_id() with === inside of:

  • CUAR_RootPageAddOn::redirect_to_main_page
  • CUAR_AbstractPageAddOn::redirect_guests_if_required
@vpratfr
Copy link
Member

vpratfr commented Feb 14, 2018

Hi,

I just released a fix for #297 which could work for that one also. If you can try out the develop branch that would be great. Else you'll need to wait until we release 7.5.0.

Putting that one on hold for now.

Thanks for the report though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants