• Resolved sneike

    (@sneike)


    Using the wordpress android application, if you create a new post from the app, it is automatically assigned to the default polylang language.

    Instead, uploading a new media from the app, it won’t have any default language assigned! This means that if I create a new gallery in a post containing these pictures, they won’t show.

    Any chance to solve this issue behaving in the same way as the posts? (i.e. new media uploaded by the app will have the default polylang language assigned.)

    Thanks for your support
    DNL

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    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);
    	}
    }

    Thread Starter sneike

    (@sneike)

    Great Chouby, it works fine! Every media I add from the wordpress android app has now the default language set! 🙂

    Will you implement these lines of code in the next versions? Or I need to backup the modified file every time I will update?

    Thanks
    Daniele

    Plugin Author Chouby

    (@chouby)

    Thanks for your feedback.
    I will include the fix in the future version.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wordpress android app’ is closed to new replies.