Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: Polylang] wordpress android app"

$
0
0

Hi!

I can't test it myself. Can you try to edit the file polylang/frontend/frontend-filters.php

At line 48, add:

add_action('add_attachment', array(&$this, 'set_default_language'));

At the end of the file, just *before* the last }, add:

public function set_default_language($post_id) {
	if (!$this->model->get_post_language($post_id)) {
		if (isset($_REQUEST['lang']))
			$this->model->set_post_language($post_id, $_REQUEST['lang']);

		elseif (($parent_id = wp_get_post_parent_id($post_id)) && $parent_lang = $this->model->get_post_language($parent_id))
			$this->model->set_post_language($post_id, $parent_lang);

		else
			$this->model->set_post_language($post_id, $this->curlang);
	}
}

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>