I have a system built on WordPress where we’re using several custom post types, and I’m seeing some weird behaviour.
For instance, I have a CPT called “Flyers”, and I also have a CPT called “Templates”. The Templates CPT has a post called “Flyers”. In Flyers CPT I have a post called “Flyer 01”.
Now when I try to $_POST to the Flyer 01 permalink (/flyers/flyer-01/) it looks like WordPress is redirecting my request to Templates post called Flyers (/templates/flyers/).
Does anyone have any good ideas on what’s going on here? And how do I get it to stop doing that redirect?
Once you are using
POST
method, so url is not visible (and search engines don’t take is into account), send the request using query string:In this way the url generated is something like
http://example.com?post_type=flyers&post_name=flyer-01
is ugly to see, but no one have to see it… and it works (it should).