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

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