add_rewrite_endpint() / WP_rewrite::add_endpoint don’t seem to honour $places
-
I’m working on a plugin that needs to add the ability to append /outputxml/ to all WP URLs, and have those URLs resolve as if they did not have /outputxml/ on them.
I have this working for Permalinks to posts, but I get a 404 error whenever I use any other type of URL. You can see what I did to get this working on permalinks here: https://johnbeales.com/20090824/endpoints-a-little-secret-for-url-manipulation-in-wordpress/
It seems that in my register_activation_hook function, when I call add_rewrite_endpoint() it only adds the endpoint to permalinks, not to category views, archives, the root, (blog home URL), or anything else that I’ve discovered. I have passing an array of all different URL types that exist as my $places variable. I have also tried just using, for example, EP_MONTH. In both situations the endpoint only resolves for permalinks, but not for any archives or any other URLs. I have also tried EP_ALL with the same result.
I am deactivating and reactivating my plugin after every change.
Does anyone out there know what I should be doing to make my endpoints work on all URL types, (well, maybe except for attachments)?
Thanks in advance
- The topic ‘add_rewrite_endpint() / WP_rewrite::add_endpoint don’t seem to honour $places’ is closed to new replies.