CalebBarnes / nextwp

http://nextwp.org/
8 stars 0 forks source link

Multilingual support #79

Open Renesauve opened 6 months ago

Renesauve commented 6 months ago

I just want to make note of this as it will be something I want to add, it would be cool to be able to pass lang params to the get-archive-page function (and any others that make sense) as it will only query the specific language if the rest api request has for example ?lang=fr at the end of it as a param

More info here: https://polylang.pro/doc/rest-api/

This would make it so instead of getting all the posts (the way it works right now) we only get the specific language of the page (archive) it's on.

Not sure the best way to do this yet but would be awesome!

Renesauve commented 6 months ago

image Basically this code here.

CalebBarnes commented 6 months ago

I think it would be pretty nice to be able to add any params in the config to be included globally or per function.

Maybe this could be included in the nextwp.config.ts

Maybe some ppl don't want to embed on every request, or don't use acf, etc.

Since editing params can possibly change the shape of the data returned from the REST API, it would also be a good idea to keep this in mind for typegen.

Maybe the cli typegen command could read the config and insert those same params.