/** * * @from 1.0 */ public function __construct() { parent::__construct(); $this->detect_language(); //add_action('plugins_loaded', array($this, 'load'), 11); add_action('init', array($this, 'init')); }
/** * @from 1.0 */ public function __construct() { parent::__construct(); add_action('init', array($this, 'update'), 15); add_action('plugins_loaded', array($this, 'find_current_language'), 11); add_action('init', array($this, 'register_postmeta_keys'), 99); add_filter('get_post_metadata', array($this, 'translate_meta_data'), null, 4); add_filter('the_posts', array($this, 'translate_the_posts'), 10, 2); add_filter('the_posts', array($this, 'hard_translate_posts'), 20, 2); add_filter('the_post', array($this, 'hard_translate_post')); add_filter('home_url', array($this, 'translate_home_url'), 10, 4); // /!\ MAY BE USED BY INTERNAL FUNCTIONS /!\ add_filter('page_link', array($this, 'translate_page_link'), 10, 3); add_filter('post_type_link', array($this, 'translate_custom_post_link'), 10, 3); add_filter('list_cats', array($this, 'translate_term_name'), 10, 2); add_filter('get_the_terms', array($this, 'translate_post_terms'), 10, 3); // filter in get_the_terms() add_filter('single_term_title', array($this, 'filter_single_term_title')); // filter term title add_filter('single_cat_title', array($this, 'filter_single_term_title')); // filter term title add_filter('single_tag_title', array($this, 'filter_single_term_title')); // filter term title add_filter('get_terms', array($this, 'translate_get_terms'), 10, 3); // translate post list of categories // for ajax add_filter('get_term', array($this, 'translate_get_term'), 10, 2); add_filter('get_edit_post_link', array($this, 'translate_edit_post_link'), null, 3); // restore post data before post saves add_filter('wp_insert_post_data', array($this, 'insert_post'), 10, 2); // save post translation after post saves add_action('save_post', array($this, 'save_translation_post_data'), 10, 2); // delete all translations when a post is deleted add_action('delete_post', array($this, 'delete_post_translations')); add_filter('preview_post_link', array($this, 'translate_preview_post_link'), null, 2); // javascript for ajax add_action('admin_footer-post.php', array($this, 'print_javascript_ajax_hook')); add_action('admin_footer-edit.php', array($this, 'print_javascript_ajax_hook')); add_action('admin_footer-edit-tags.php', array($this, 'print_javascript_ajax_hook')); // edit post meta data add_filter('update_post_metadata', array($this, 'update_translated_postmeta'), null, 5); add_filter('add_post_metadata', array($this, 'add_translated_postmeta'), null, 5); add_filter('delete_post_metadata', array($this, 'delete_translated_meta_data'), null, 5); // term add_action('edit_term', array($this, 'save_term_translation'), null, 3); add_action('delete_term', array($this, 'delete_term_translations'), 10, 4); // translate walker for pages dropdown add_filter('list_pages', array($this, 'translate_list_pages'), 10, 2); }