I have a problem with changing the rest url prefix. If I make a change by using the rest_url_prefix hook from 'wp-json' to 'api', the wpml translation orders do not work and the query
api/wpml/tm/v1/jobs/?limit=20&offset=0&sorting%5Bid%5D=desc&pageName=tm-jobs
reports that it does not find routing. Without changing the rest api prefix, everything works fine.
add_filter('rest_url_prefix', function () {
return 'api';
});
Reference to our recent chat, I am trying to reproduce the issue in a clean install. However, in the meanwhile, are there any particular steps or scenarios which can be helpful in reproducing the said issue?
Please explain to me how this will help solve the problem. I use this hook to change the prefix for the entire REST API. And only your plugin has a problem with this.
As per the recent discussion, the team suggested that:
> First the user should make sure that the rest prefix is changed before anything is executed. This means loading the logic in a mu-plugin and not just anywhere else.
which is recommended in the errata.
Since you may be using it in your code, like a regular plugin or may be theme's functions.php file, what if you use it in an mu-plugin and it may help about the problem?
If this does not fix it, then start replacing.
1) First in the file: wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/class-wpml-rest-request-analyze.php
2) Then in the file: wp-content/plugins/sitepress-multilingual-cms/classes/REST/RewriteRules.php and then in the file: wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/class-wpml-rest.php
Remember to take full backup before proceeding.
Additionally, the issue is with our dev team, which may take some time, since there's no ETA so far. The above mentioned may give you a temporary solution.
You may also subscribe to the comments on that Errata, about any future updates.
Please let me know if the above mentioned works for you.