wpdb = $wpdb; $this->sitepress = $sitepress; } public function render( ) { $all_languages = $this->sitepress->get_languages(); ?> change_language_of_strings( $strings, $lang ); if ( $response[ 'success' ] ) { $strings_in = implode(',', $strings); $update_query = "UPDATE {$this->wpdb->prefix}icl_strings SET language=%s WHERE id IN ($strings_in)"; $update_prepare = $this->wpdb->prepare( $update_query, $lang ); $this->wpdb->query( $update_prepare ); $response[ 'success' ] = true; foreach( $strings as $string ) { icl_update_string_status( $string ); } } return $response; } }