API language selection
-
Hello there,
I have a request for one of my client. I had to code a plugin that allows him to chose any post (including CPTs) from gutenberg inside a custom block. He now asks me if it would be possible to use polylang to filter the list of posts based on its language. I can’t seem to find anything when I log my getEntityRecords about language (except the slug that I could parse but it’s not great…).
My question is : is it possible to get language listed inside getEntityRecords with the pro version ? Also is it possible to get the language of the page in which the user is loading my custom block ?
I’d like to have something like this :
const posts = useSelect<Post[] | null>(select => select("core").getEntityRecords("postType", post_type, { per_page: 99, language: "fr", }) );
The topic ‘API language selection’ is closed to new replies.