Code Duplication    Length = 6-7 lines in 2 locations

core/Field/Association_Field.php 1 location

@@ 76-81 (lines=6) @@
73
	 */
74
	public function set_value_from_input( $input ) {
75
		$value = array();
76
		if ( isset( $input[ $this->get_name() ] ) ) {
77
			$value = stripslashes_deep( $input[ $this->get_name() ] );
78
			if ( is_array( $value ) ) {
79
				$value = array_values( $value );
80
			}
81
		}
82
		$this->set_value( $value );
83
	}
84

core/Field/Set_Field.php 1 location

@@ 57-63 (lines=7) @@
54
	public function set_value_from_input( $input ) {
55
		if ( ! isset( $input[ $this->name ] ) ) {
56
			$this->set_value( array() );
57
		} else {
58
			$value = stripslashes_deep( $input[ $this->name ] );
59
			if ( is_array( $value ) ) {
60
				$value = array_values( $value );
61
			}
62
			$this->set_value( $value );
63
		}
64
	}
65
66
	/**