PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
<?php use WPML\API\Sanitize; class WPML_TM_Troubleshooting_Clear_TS extends WPML_TM_AJAX_Factory_Obsolete { private $script_handle = 'wpml_clear_ts'; /** * WPML_TM_Troubleshooting_Clear_TS constructor. * * @param WPML_WP_API $wpml_wp_api */ public function __construct( &$wpml_wp_api ) { parent::__construct( $wpml_wp_api ); add_action( 'init', array( $this, 'load_action' ) ); $this->add_ajax_action( 'wp_ajax_wpml_clear_ts', array( $this, 'clear_ts_action' ) ); $this->init(); } public function clear_ts_action() { $action = Sanitize::stringProp( 'action', $_POST ); $wpml_clear_ts_nonce = Sanitize::stringProp( 'nonce', $_POST ); $valid_nonce = wp_verify_nonce( $wpml_clear_ts_nonce, $action ); if ( $valid_nonce && $_POST ) { $this->clear_tp_default_suid(); return $this->wpml_wp_api->wp_send_json_success( __( 'Ok!', 'wpml-translation-management' ) ); } else { return $this->wpml_wp_api->wp_send_json_error( __( "You can't do that!", 'wpml-translation-management' ) ); } } protected function clear_tp_default_suid() { TranslationProxy::clear_preferred_translation_service(); } public function enqueue_resources( $hook_suffix ) { if ( $this->wpml_wp_api->is_troubleshooting_page() ) { $this->register_resources(); $strings = array( 'placeHolder' => $this->script_handle, 'action' => $this->script_handle, 'nonce' => wp_create_nonce( $this->script_handle ), ); wp_localize_script( $this->script_handle, $this->script_handle . '_strings', $strings ); wp_enqueue_script( $this->script_handle ); } } public function register_resources() { wp_register_script( $this->script_handle, WPML_TM_URL . '/res/js/clear-preferred-ts.js', array( 'jquery', 'jquery-ui-dialog' ), false, true ); } public function load_action() { $page = Sanitize::stringProp( 'page', $_GET ); $should_proceed = ! $this->wpml_wp_api->is_heartbeat() && ! $this->wpml_wp_api->is_ajax() && ! $this->wpml_wp_api->is_cron_job() && $page && strpos( $page, 'sitepress-multilingual-cms/menu/troubleshooting.php' ) === 0; if ( $should_proceed && TranslationProxy::get_tp_default_suid() ) { $this->add_hooks(); } } private function add_hooks() { add_action( 'after_setup_complete_troubleshooting_functions', array( $this, 'render_ui' ) ); } public function render_ui() { if ( TranslationProxy::get_tp_default_suid() ) { $clear_ts = new WPML_TM_Troubleshooting_Clear_TS_UI(); $clear_ts->show(); } } }
[+]
wpml-wp
[+]
ajax
[-] class-wpml-tm-translators-dropdown.php
[edit]
[+]
translation-priorities
[-] class-wpml-tm-promotions.php
[edit]
[+]
hooks
[+]
ICL-20-migration
[+]
templates
[+]
action-filter-loader
[-] class-wpml-translation-proxy-api.php
[edit]
[+]
wpml-st
[+]
utilities
[-] class-wpml-tm-translated-field.php
[edit]
[+]
requirements
[+]
sticky-posts
[-] class-wpml-tm-page.php
[edit]
[+]
icl
[+]
display-as-translated
[+]
custom-field-translation
[+]
language
[+]
ATE
[+]
shortcodes
[+]
translate_link_targets
[+]
core-abstract-classes
[+]
full-site-editing
[+]
settings
[-] class-wpml-file.php
[edit]
[+]
xliff
[+]
reset
[+]
REST-hooks
[+]
comments
[+]
plugins
[+]
templating
[+]
container
[+]
taxonomy
[+]
cookie
[-] class-wpml-tm-requirements.php
[edit]
[+]
translation-dashboard
[+]
helpers
[+]
translation-feedback
[+]
admin-language-switcher
[-] class-wpml-tm-troubleshooting-clear-ts.php
[edit]
[+]
jobs
[+]
compatibility
[+]
wp-core-hooks
[+]
post-edit-screen
[-] class-wpml-tm-troubleshooting-clear-ts-ui.php
[edit]
[+]
translation-jobs
[+]
logging
[+]
roles
[+]
media
[-] class-wpml-active-plugin-provider.php
[edit]
[+]
media-translation
[-] class-wpml-config-update.php
[edit]
[+]
seo
[+]
options
[+]
Installer
[-] class-wpml-tm-ajax-factory-2.php
[edit]
[+]
automatic-translation
[+]
troubleshoot
[+]
records
[-] class-wpml-translate-independently.php
[edit]
[+]
abstract
[-] class-wpml-tm-resources-factory.php
[edit]
[+]
post-types
[+]
wp-cli
[+]
translation-proxy
[-] class-wpml-tm-loader.php
[edit]
[-] class-wpml-config-update-integrator.php
[edit]
[-] class-wpml-theme-localization-type.php
[edit]
[+]
taxonomy-term-translation
[+]
setup
[+]
language-switcher
[+]
translation-mode
[+]
jobs-deadline
[+]
database-queries
[+]
utils
[+]
translation-basket
[-] ISitePress.php
[edit]
[-] class-wpml-current-screen.php
[edit]
[-] class-wpml-tm-ajax-factory.php
[edit]
[+]
admin-bar
[+]
canonicals
[+]
custom-xml-config
[-] class-wpml-db-chunk.php
[edit]
[+]
url-handling
[+]
admin-resources
[+]
theme-plugin-localization
[+]
ui-elements
[+]
languages
[+]
wizard
[-] LanguageNegotiation.php
[edit]
[-] class-wpml-browser-redirect.php
[edit]
[+]
menu
[-] class-wpml-mo-file-search.php
[edit]
[+]
query-filtering
[+]
translation-management
[+]
filters
[-] class-wpml-xmlrpc.php
[edit]
[-] class-wpml-site-id.php
[edit]
[+]
block-editor
[+]
icl-to-ate-migration
[+]
translations
[+]
user-language
[+]
..
[+]
menu-elements
[+]
translation-batch
[-] class-wpml-tm-api.php
[edit]
[-] class-wpml-translation-management.php
[edit]
[-] class-wpml-translation-job-factory.php
[edit]
[+]
xml-config
[+]
REST
[+]
editor
[+]
admin-menu
[+]
localization
[+]
tp-client
[+]
translation-roles
[-] Geolocalization.php
[edit]
[+]
wp
[+]
API
[+]
twig-extensions
[+]
troubleshooting
[+]
privacy
[+]
user
[-] class-wpml-tm-service-activation-ajax.php
[edit]
[+]
widgets
[+]
super-globals
[+]
emails
[+]
words-count
[+]
support
[+]
post-translation
[+]
browser-language-redirect
[+]
request-handling
[+]
notices
[+]
upgrade