Answer the question
In order to leave comments, you need to log in
How to make a request depending on the current language?
Site on wp, multilingual. Polylang plugin
such sql query returns all posts in both English and Russian.
SELECT * FROM $wpdb->posts WHERE post_type = 'post'
SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND locale=ru
???
Answer the question
In order to leave comments, you need to log in
A language in polylang is a custom taxonomy. Look in a DB as it stores the data.
An example of an array when using a class for database queries:
$args = array(
'category' => pll_get_term(34)
);
You can get the current localization with get_locale()
. Returns the string en_US, ru_RU, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question