Hello @vespino,
Just add the following filter to your functions page to change the API base. The below will change the REST api route from example.com/wp-json/wp/v2/ to example.com/api/wp/v2/.
I don’t think changing the namespace is good idea!!.
add_filter( ‘rest_url_prefix’, ‘my_theme_api_slug’);
function my_theme_api_slug( $slug ) {
return ‘api’;
}
That is something I already found but does not quite solve the issue, does it? If the guys at WordPress decide to change /v2 to /v3 I still have the same problem.
There is something called register_rest_route to create custom API routes. I don’t have much idea about.
Does this logic work for you
Inside app – > fetch the value of comment API dynamically
For example read a text file over url which has the comment API URL mentioned. Even if the comment url changes in the future, you can simply change the URL in the text file the same will be reflected in the app coding?
Does it work for you?
That would work, but only as a final resort since I believe this creates unnecessary traffic to the server and certain values must be set on the server.
I’m not an expert developer. But, my logic says that there should be a file which will check by the app every time and should work based on the data on the file.
For example: The remote file should have a variable named Force_update: this value either be yes or no. If in case you find any major bug in your previous app release, you can just refer it as yes and can force the users to update the app.
I’m not sure whether any other option available inside android development toolkit to deal with such issues!