Code Duplication    Length = 6-6 lines in 3 locations

classes/class-lsx-wetu-importer-accommodation.php 1 location

@@ 456-461 (lines=6) @@
453
			}
454
			delete_option( 'lsx_wetu_importer_accommodation_settings' );
455
456
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
457
				$content = array_map( 'sanitize_text_field', wp_unslash( $_POST['content'] ) );
458
				add_option( 'lsx_wetu_importer_accommodation_settings',$content );
459
			} else {
460
				$content = false;
461
			}
462
463
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
464

classes/class-lsx-wetu-importer-tours.php 1 location

@@ 450-455 (lines=6) @@
447
448
			delete_option( 'lsx_wetu_importer_tour_settings' );
449
450
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
451
				$content = array_map( 'sanitize_text_field', wp_unslash( $_POST['content'] ) );
452
				add_option( 'lsx_wetu_importer_tour_settings',$content );
453
			} else {
454
				$content = false;
455
			}
456
			$jdata = wp_remote_get( 'https://wetu.com/API/Itinerary/V8/Get?id=' . $wetu_id );
457
458
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {

classes/class-lsx-wetu-importer-destination.php 1 location

@@ 498-503 (lines=6) @@
495
496
			delete_option( 'lsx_wetu_importer_destination_settings' );
497
498
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
499
				$content = array_map( 'sanitize_text_field', wp_unslash( $_POST['content'] ) );
500
				add_option( 'lsx_wetu_importer_destination_settings', $content );
501
			} else {
502
				$content = false;
503
			}
504
505
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
506