PluginProbe
Translate and Go multilingual – Automatic AI translation – wpLingua / 2.16.7
Translate and Go multilingual – Automatic AI translation – wpLingua v2.16.7
2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 1.1.0 All 112 releases
← All changes | inc/buffering.php +16 -10 2.12.12.16.7 View file →
@@ -63,9 +63,11 @@
63 63 * @return void
64 64 */
65 65 function wplng_ob_start() {
66 66
67 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
67 + if ( wp_doing_cron() ) {
68 + return;
69 + } elseif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
68 70
69 71 /**
70 72 * Is an AJAX call
71 73 */
@@ -185,20 +187,22 @@
185 187 function wplng_ob_callback_ajax( $output ) {
186 188
187 189 global $wplng_request_uri;
188 190
191 + $output_translated = $output;
192 +
189 193 if ( wplng_str_is_json( $output ) ) {
190 194
191 - $output_translated = wplng_translate_json( $output );
195 + $output_translated = apply_filters( 'wplng_intercepted_json', $output_translated );
196 + $output_translated = wplng_translate_json( $output_translated );
197 + $output_translated = apply_filters( 'wplng_translated_json', $output_translated );
192 198
193 199 } elseif ( wplng_str_is_html( $output ) ) {
194 200
195 - $output_translated = wplng_translate_html( $output );
201 + $output_translated = apply_filters( 'wplng_intercepted_html', $output_translated );
202 + $output_translated = wplng_translate_html( $output_translated );
203 + $output_translated = apply_filters( 'wplng_translated_html', $output_translated );
196 204
197 - } else {
198 -
199 - $output_translated = $output;
200 -
201 205 }
202 206
203 207 // Print debug data in debug.log file
204 208 if ( true === WPLNG_DEBUG_AJAX ) {
@@ -314,12 +318,14 @@
314 318 function wplng_ob_callback_wp_json( $output ) {
315 319
316 320 global $wplng_request_uri;
317 321
322 + $output_translated = $output;
323 +
318 324 if ( wplng_str_is_json( $output ) ) {
319 - $output_translated = wplng_translate_json( $output );
320 - } else {
321 - $output_translated = $output;
325 + $output_translated = apply_filters( 'wplng_intercepted_json', $output_translated );
326 + $output_translated = wplng_translate_json( $output_translated );
327 + $output_translated = apply_filters( 'wplng_translated_json', $output_translated );
322 328 }
323 329
324 330 // Print debug data in debug.log file
325 331 if ( true === WPLNG_DEBUG_REST ) {