示例#1
0
 public function __construct(&$polylang)
 {
     parent::__construct($polylang);
     if (!did_action('pll_language_defined')) {
         $this->set_language_from_url();
     }
 }
 public function __construct(&$polylang)
 {
     parent::__construct($polylang);
     if (!did_action('pll_language_defined')) {
         // set the languages from content
         add_action('wp', array(&$this, 'wp'), 5);
         // priority 5 for post types and taxonomies registered in wp hook with default priority
         // if no language found, choose the preferred one
         add_filter('pll_get_current_language', array(&$this, 'pll_get_current_language'));
     }
 }