string_factory = &$string_factory; $this->language_of_domain = new WPML_Language_Of_Domain( $sitepress ); } public function render( $domains ) { $all_languages = $this->sitepress->get_languages( $this->sitepress->get_admin_language() ); ?>
change_language_of_strings_in_domain( $domain, $langs, $to_lang ); if ( ! empty( $langs ) ) { foreach ( $langs as &$lang ) { $lang = "'" . $lang . "'"; } $langs = implode( ',', $langs ); $string_ids = $this->wpdb->get_col( $this->wpdb->prepare( "SELECT id FROM {$this->wpdb->prefix}icl_strings WHERE context=%s AND language IN ($langs)", $domain ) ); foreach ( $string_ids as $str_id ) { $this->string_factory->find_by_id( $str_id )->set_language( $to_lang ); } } if ( $set_as_default ) { $lang_of_domain = new WPML_Language_Of_Domain( $this->sitepress ); $lang_of_domain->set_language( $domain, $to_lang ); } $string_ids = $this->wpdb->get_col( $this->wpdb->prepare( "SELECT id FROM {$this->wpdb->prefix}icl_strings WHERE context = %s", $domain ) ); foreach ( $string_ids as $strid ) { $this->string_factory->find_by_id( $strid )->update_status(); } return array( 'success' => true ); } }