Code Duplication    Length = 4-5 lines in 2 locations

classes/class-tours.php 2 locations

@@ 736-739 (lines=4) @@
733
	 */
734
	public function set_price($data,$id) {
735
	    //Price
736
		if(isset($data['price']) && ''!== $data['price']){
737
            $price = preg_replace("/[^0-9,.]/", "", $data['price']);
738
            $this->save_custom_field($price,'price',$id);
739
		}
740
741
		//Price includes
742
		if(isset($data['price_includes']) && ''!== $data['price_includes']){
@@ 757-761 (lines=5) @@
754
	 * Set the duration
755
	 */
756
	public function set_duration($data,$id) {
757
		if(isset($data['days']) && !empty($data['days'])){
758
			$price = $data['days'];
759
			$price = preg_replace("/[^0-9,.]/", "", $price);
760
			$this->save_custom_field($price,'duration',$id);
761
		}
762
	}
763
764
	/**