Bug with custom post type
-
Hi all,
i notice a bug with custom post type with emphasis (i use them, i’m french) and pagination.
i’m currently developing a website where i use my own custom post type for accomodation/restaurant.
So a user can select a type of accomodation/restaurant (eg : H?tel, Restaurant, Camping, etc.) by clicking on a tag then it can refine its choice by click on a tag of the town name (eg : Villers-Cotterêts).
The problem is that, if the name of the town contains an emphasis when i click on “Next page” i got a 301 redirect and my emphasis caracters are removed during the redirection :(… So the name of town (Villers-Cotterêts) becomes “Villers-Cotterts” and no record is found…Of course, i’ve tried to hard code the name of the town in my ‘meta_value’ and then, everything works fine. Despite the redirection, WP show me the next pages for the selected criteria.
In my code, i use a syntax with querystring to generate my url.
example : https://mywebsite.fr/commerce/type/restaurant/?ville=Villers-Cotter%C3%AAts so the next page link (generated by the ‘next_posts_link’ function) will be https://mywebsite.fr/commerce/type/restaurant/page/2/?ville=Villers-Cotter%C3%AAts but if i click on it the WP redirect me (by a 301 error) to https://mywebsite.fr/commerce/type/hotel/page/2/?ville=Villers-Cotterts (notice the removing of ê).[EDIT]It seems that WP removes space in names too…[/EDIT]
Does someone have a solution/hack to bypass this ?
TIA.
Amicably,
Pierre.
- The topic ‘Bug with custom post type’ is closed to new replies.