public function __construct(&$links_model) { parent::__construct($links_model); add_action('pll_language_defined', array(&$this, 'pll_language_defined'), 1); // filters posts by language add_action('parse_query', array(&$this, 'parse_query'), 6); // not before 'check_language_code_in_url' if (!defined('PLL_AUTO_TRANSLATE') || PLL_AUTO_TRANSLATE) { add_action('wp', array(&$this, 'auto_translate'), 20); } }
/** * constructor * * @since 1.2 * * @param object $links_model */ public function __construct(&$links_model) { parent::__construct($links_model); add_action('pll_language_defined', array(&$this, 'pll_language_defined'), 1); // avoids the language being the queried object when querying multiple taxonomies add_action('parse_tax_query', array(&$this, 'parse_tax_query'), 1); // filters posts by language add_action('parse_query', array(&$this, 'parse_query'), 6); // not before 'check_canonical_url' if (!defined('PLL_AUTO_TRANSLATE') || PLL_AUTO_TRANSLATE) { add_action('template_redirect', array(&$this, 'auto_translate'), 7); } }
public function __construct(&$links_model) { parent::__construct($links_model); // plugin i18n, only needed for backend load_plugin_textdomain('polylang', false, basename(POLYLANG_DIR) . '/languages'); // adds the link to the languages panel in the WordPress admin menu add_action('admin_menu', array(&$this, 'add_menus')); // setup js scripts and css styles add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts')); add_action('admin_print_footer_scripts', array(&$this, 'admin_print_footer_scripts')); // adds a 'settings' link in the plugins table add_filter('plugin_action_links_' . POLYLANG_BASENAME, array(&$this, 'plugin_action_links')); add_action('in_plugin_update_message-' . POLYLANG_BASENAME, array(&$this, 'plugin_update_message'), 10, 2); }
/** * Loads the polylang text domain * Setups actions needed on all admin pages * * @since 1.8 * * @param object $links_model */ public function __construct(&$links_model) { parent::__construct($links_model); // Plugin i18n, only needed for backend load_plugin_textdomain('polylang', false, basename(POLYLANG_DIR) . '/languages'); // Adds the link to the languages panel in the WordPress admin menu add_action('admin_menu', array($this, 'add_menus')); // Setup js scripts and css styles add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts')); // Lingotek if (!defined('PLL_LINGOTEK_AD') || PLL_LINGOTEK_AD) { require_once POLYLANG_DIR . '/lingotek/lingotek.php'; } }