Code Duplication    Length = 7-7 lines in 3 locations

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

@@ 479-485 (lines=7) @@
476
			delete_option( 'wetu_importer_accommodation_settings' );
477
478
			// @codingStandardsIgnoreLine
479
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
480
				// @codingStandardsIgnoreLine
481
				$content = $_POST['content'];
482
				add_option( 'wetu_importer_accommodation_settings',$content );
483
			} else {
484
				$content = false;
485
			}
486
487
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
488

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

@@ 512-518 (lines=7) @@
509
			delete_option( 'wetu_importer_destination_settings' );
510
511
			// @codingStandardsIgnoreLine
512
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
513
				// @codingStandardsIgnoreLine
514
				$content = $_POST['content'];
515
				add_option( 'wetu_importer_destination_settings', $content );
516
			} else {
517
				$content = false;
518
			}
519
520
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
521

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

@@ 538-544 (lines=7) @@
535
			delete_option( 'wetu_importer_tour_settings' );
536
537
			// @codingStandardsIgnoreLine
538
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
539
				// @codingStandardsIgnoreLine
540
				$content = $_POST['content'];
541
				add_option( 'wetu_importer_tour_settings',$content );
542
			} else {
543
				$content = false;
544
			}
545
			$jdata = wp_remote_get( 'https://wetu.com/API/Itinerary/V8/Get?id=' . $wetu_id );		
546
547
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {