public function __construct(&$polylang) { parent::__construct($polylang); if (!did_action('pll_language_defined')) { $this->set_language_from_url(); } }
public function init() { parent::init(); if (!did_action('pll_language_defined')) { $this->set_language_from_url(); } add_action('request', array(&$this, 'request')); }
/** * sets the language from content * * @since 1.2 */ public function wp() { // nothing to do if the language has already been set ( although normally the filter has been removed ) if (!$this->curlang && ($curlang = $this->get_language_from_content())) { parent::set_language($curlang); } }