Code Duplication    Length = 7-7 lines in 3 locations

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

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

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

@@ 504-510 (lines=7) @@
501
			delete_option( 'wetu_importer_destination_settings' );
502
503
			// @codingStandardsIgnoreLine
504
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
505
				// @codingStandardsIgnoreLine
506
				$content = $_POST['content'];
507
				add_option( 'wetu_importer_destination_settings', $content );
508
			} else {
509
				$content = false;
510
			}
511
512
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
513

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

@@ 462-468 (lines=7) @@
459
			delete_option( 'wetu_importer_tour_settings' );
460
461
			// @codingStandardsIgnoreLine
462
			if ( isset( $_POST['content'] ) && is_array( $_POST['content'] ) && ! empty( $_POST['content'] ) ) {
463
				// @codingStandardsIgnoreLine
464
				$content = $_POST['content'];
465
				add_option( 'wetu_importer_tour_settings',$content );
466
			} else {
467
				$content = false;
468
			}
469
			$jdata = wp_remote_get( 'https://wetu.com/API/Itinerary/V8/Get?id=' . $wetu_id );		
470
471
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {