/** * This function is to be used on setting a taxonomy from untranslated to being translated. * It creates potentially missing translations and reassigns posts to the then created terms in the correct language. * This function affects all terms in a taxonomy and therefore, depending on the database size results in * heavy resource demand. It should not be used to fix term and post assignment problems other than those * resulting from the action of turning a translated taxonomy into an untranslated one. * * An exception is being made for the installation process assigning all existing terms the default language, * given no prior language information is saved about them in the database. * * @param $taxonomy string */ function verify_taxonomy_translations($taxonomy) { $sync_settings = $this->get_setting('taxonomies_sync_option'); if ($this->get_setting('setup_complete') && (!isset($sync_settings[$taxonomy]) || !$sync_settings[$taxonomy])) { $tax_sync = new WPML_Term_Language_Synchronization($taxonomy); $tax_sync->set_translated(); } elseif (!$this->get_setting('setup_complete')) { WPML_Term_Language_Synchronization::set_initial_term_language($taxonomy); } }
/** * This function is to be used on setting a taxonomy from untranslated to being translated. * It creates potentially missing translations and reassigns posts to the then created terms in the correct language. * This function affects all terms in a taxonomy and therefore, depending on the database size results in * heavy resource demand. It should not be used to fix term and post assignment problems other than those * resulting from the action of turning a translated taxonomy into an untranslated one. * * An exception is being made for the installation process assigning all existing terms the default language, * given no prior language information is saved about them in the database. * * @param $taxonomy string */ function verify_taxonomy_translations($taxonomy) { require_once "inc/taxonomy-term-translation/wpml-term-language-sychronization.class.php"; $setup_complete = $this->get_setting('setup_complete'); if ($setup_complete) { $tax_sync = new WPML_Term_Language_Synchronization($taxonomy); $tax_sync->set_translated(); } else { WPML_Term_Language_Synchronization::set_initial_term_language($taxonomy); } }
/** * This function is to be used on setting a taxonomy from untranslated to being translated. * It creates potentially missing translations and reassigns posts to the then created terms in the correct language. * This function affects all terms in a taxonomy and therefore, depending on the database size results in * heavy resource demand. It should not be used to fix term and post assignment problems other than those * resulting from the action of turning a translated taxonomy into an untranslated one. * * An exception is being made for the installation process assigning all existing terms the default language, * given no prior language information is saved about them in the database. * * @param $taxonomy string */ function verify_taxonomy_translations($taxonomy) { $term_utils = new WPML_Terms_Translations(); $tax_sync = new WPML_Term_Language_Synchronization($taxonomy, $this, $this->wpdb, $term_utils); if ($this->get_setting('setup_complete')) { $tax_sync->set_translated(); } else { $tax_sync->set_initial_term_language(); } delete_option($taxonomy . '_children', array()); }