Code Duplication    Length = 7-7 lines in 2 locations

classes/PodsI18n.php 2 locations

@@ 340-346 (lines=7) @@
337
					 * In polylang the preferred language could be anything.
338
					 * When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language
339
					 */
340
					if (   $translator == 'PLL'
341
					       && ! empty( $_GET['new_lang'] )
342
					       && ! empty( $_GET['post_type'] )
343
					       && pll_is_translated_post_type( sanitize_text_field( $_GET['post_type'] ) )
344
					) {
345
						$current_language = $_GET['new_lang'];
346
					}
347
348
					/**
349
					 * Overwrite the current language if needed for taxonomies
@@ 392-398 (lines=7) @@
389
					 * In polylang the preferred language could be anything.
390
					 * When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language
391
					 */
392
					if (   $translator == 'PLL'
393
					       && ! empty( $_GET['new_lang'] )
394
					       && ! empty( $_GET['taxonomy'] )
395
					       && pll_is_translated_taxonomy( sanitize_text_field( $_GET['taxonomy'] ) )
396
					) {
397
						$current_language = $_GET['new_lang'];
398
					}
399
				}
400
			}
401
		}