Code Duplication    Length = 8-9 lines in 2 locations

core/Field/Group_Field.php 1 location

@@ 157-164 (lines=8) @@
154
	 * @param  string $label If null, the label will be generated from the group name
155
	 * @return self   $this
156
	 */
157
	public function set_label( $label ) {
158
		if ( is_null( $label ) ) {
159
			// Try to guess field label from its name
160
			$label = Helper::normalize_label( $this->get_name() );
161
		}
162
		$this->label = $label;
163
		return $this;
164
	}
165
166
	/**
167
	 * Label attribute getter.

core/Field/Field.php 1 location

@@ 704-712 (lines=9) @@
701
	 * @param  string $label If null, the label will be generated from the field name
702
	 * @return self   $this
703
	 */
704
	public function set_label( $label ) {
705
		if ( is_null( $label ) ) {
706
			// Try to guess field label from its name
707
			$label = Helper::normalize_label( $this->get_name() );
708
		}
709
710
		$this->label = $label;
711
		return $this;
712
	}
713
714
	/**
715
	 * Get a key-value array of attributes