PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
wpml-string-translation
/
classes
<?php class WPML_ST_Reset { /** * @var wpdb */ private $wpdb; /** * @var WPML_ST_Settings */ private $settings; /** * @param wpdb $wpdb * @param WPML_ST_Settings $settings */ public function __construct( $wpdb, WPML_ST_Settings $settings = null ) { $this->wpdb = $wpdb; if ( ! $settings ) { $settings = new WPML_ST_Settings(); } $this->settings = $settings; } public function reset() { $this->settings->delete_settings(); // remove tables at the end to avoid errors in ST due to last actions invoked by hooks add_action( 'shutdown', array( $this, 'remove_db_tables' ), PHP_INT_MAX - 1 ); } public function remove_db_tables() { $blog_id = $this->retrieve_current_blog_id(); $is_multisite_reset = $blog_id && function_exists( 'is_multisite' ) && is_multisite(); if ( $is_multisite_reset ) { switch_to_blog( $blog_id ); } $table = $this->wpdb->prefix . 'icl_string_pages'; $this->wpdb->query( 'DROP TABLE IF EXISTS ' . $table ); $table = $this->wpdb->prefix . 'icl_string_urls'; $this->wpdb->query( 'DROP TABLE IF EXISTS ' . $table ); if ( $is_multisite_reset ) { restore_current_blog(); } } /** * @return int */ private function retrieve_current_blog_id() { $filtered_id = array_key_exists( 'id', $_POST ) ? filter_var( $_POST['id'], FILTER_SANITIZE_NUMBER_INT ) : false; $filtered_id = array_key_exists( 'id', $_GET ) && ! $filtered_id ? filter_var( $_GET['id'], FILTER_SANITIZE_NUMBER_INT ) : $filtered_id; $blog_id = false !== $filtered_id ? $filtered_id : $this->wpdb->blogid; return $blog_id; } }
[+]
string-tracking
[+]
package
[-] class-wpml-st-verify-dependencies.php
[edit]
[-] class-wpml-st-user-fields.php
[edit]
[+]
translation-memory
[+]
utilities
[-] Shortcode.php
[edit]
[+]
batch-translation
[+]
admin-texts
[-] class-wpml-st-admin-string.php
[edit]
[+]
menus
[+]
container
[-] class-wpml-st-settings.php
[edit]
[-] class-wpml-st-strings.php
[edit]
[+]
string-translation
[+]
po-import
[+]
db-mappers
[+]
shortcode
[+]
records
[+]
Troubleshooting
[+]
strings-scanning
[+]
MO
[-] class-wpml-st-initialize.php
[edit]
[+]
wpml-tm
[-] class-wpml-st-string-factory.php
[edit]
[+]
basket
[-] class-wpml-st-string-statuses.php
[edit]
[+]
string-translation-ui
[-] class-wpml-language-of-domain.php
[edit]
[+]
translation-files
[+]
translations-file-scan
[+]
filters
[+]
..
[+]
gettext-hooks
[-] TranslateWpmlString.php
[edit]
[-] class-wpml-st-string.php
[edit]
[+]
API
[+]
privacy
[+]
actions
[-] class-wpml-st-reset.php
[edit]
[+]
package-translation
[+]
support
[+]
strings-cleanup
[-] class-wpml-admin-notifier.php
[edit]
[+]
slug-translation
[+]
upgrade