' . wp_nonce_field( self::ACTION_ID, 'wpml_tm_reset_preferred_translation_service_nonce' ) . '

' . $resetTitle . '

' . $resetMessage . '

' . $resetButton . ' '; echo $html; } public function resetAndFetchPreferredTS() { $action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING ); $nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING ); if ( wp_verify_nonce( $nonce, $action ) ) { OTGS_Installer()->settings['repositories']['wpml']['ts_info']['preferred'] = null; OTGS_Installer()->refresh_subscriptions_data(); wp_send_json_success(); } else { wp_send_json_error(); } } public function enqueueScripts( $page ) { if ( WPML_PLUGIN_FOLDER . '/menu/troubleshooting.php' === $page ) { wp_enqueue_script( self::ACTION_ID, WPML_TM_URL . '/res/js/reset-preferred-ts.js', [ 'jquery' ], WPML_TM_VERSION ); } } }