Closed inc2734 closed 3 years ago
Thanks. In the 3.5 release I intentionally dropped the rewrite rules for localized REST API routes since I thought they were not necessary and the ?lang=ja
query should be used instead of /ja/
.
Now I realized that the decision was a mistake. As you pointed out, rest_url()
refers to the home URL, so the rewrite rules are anyway needed.
I'll revert the rewrite rules in the next release. Thanks again for the detailed report!
Thank you for your response!
I use my own plugin
register_rest_route()
to add the endpoint. https://github.com/inc2734/snow-monkey-forms/blob/master/snow-monkey-forms.php#L151-L173It is then called using the
rest_url()
function. https://github.com/inc2734/snow-monkey-forms/blob/master/snow-monkey-forms.php#L102rest_url()
is usingget_home_url()
internally, and Bogo is rewriting the url in thehome_url
filter hook, so I think that's affecting it. https://github.com/takayukister/bogo/blob/caecc5ebd455b85a6562eb93f489c9757f87eacd/includes/link-template.php#L141-L145※By the way, if the permalink setting is “Plain", the problem does not occur.
I'm not familiar with the rest api, so I may be wrong about the usage of
register_rest_route()
orrest_url()
.However, since the Japanese page of Contact Form 7 also rewrote the endpoint and gave me a 404 error, I thought there might be a problem with Bogo, so I reported it just in case.