Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#44277 reopened defect (bug)

Post type rewrite breaks page url's

Reported by: garethgillman's profile garethgillman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.6
Component: General Keywords:
Focuses: Cc:

Description

I have a post type which we rewrite a custom url using the following:

'slug' => '%kh_product_cat%',

It used to work but not sure when but it stopped working and although the post type url's work, the page url's don't.

Take that line out and the page url's work again, tested on a clean install of WP to make sure and get the same problem.

Has something been changed in WP recently which would affect this?

Change History (5)

#1 @tobifjellner
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This trac instance is used to follow-up on confirmed bugs and improvement suggestions in WordPress core.
In this case, where you try to figure out what's happened on your site and how to fix it, the support forums at support.wordpress.org is a much better place.

#2 @garethgillman
6 years ago

I believe this is a WP bug, I have got help from other sources to see if it was my code causing the error and we can't find anything that will cause it.

I then used a brand new install of WP to test if it's something in my code that I may have missed and get the same result.

Not sure what else I can do, we have done everything we can to try and fix it in our code and got no where.

#3 @tobifjellner
6 years ago

Where is this variable defined? Most WordPress variables have names that start with wp_.

#4 @garethgillman
6 years ago

The variable is defined in a filter which uses str_replace to change it, this works fine and removing the filter doesn't affect the above, as I said, adding the variable to the slug breaks the page permalinks across the site.

#5 @garethgillman
6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Giving this a bump as we are pretty sure this is a bug, we are fine with a temporary fix if it means we can get this working until the core team can find a solution.

Note: See TracTickets for help on using tickets.