core/Field/Field.php 1 location
|
@@ 706-714 (lines=9) @@
|
| 703 |
|
* @param string $label If null, the label will be generated from the field name |
| 704 |
|
* @return Field $this |
| 705 |
|
*/ |
| 706 |
|
public function set_label( $label ) { |
| 707 |
|
if ( is_null( $label ) ) { |
| 708 |
|
// Try to guess field label from it's name |
| 709 |
|
$label = Helper::normalize_label( $this->get_name() ); |
| 710 |
|
} |
| 711 |
|
|
| 712 |
|
$this->label = $label; |
| 713 |
|
return $this; |
| 714 |
|
} |
| 715 |
|
|
| 716 |
|
/** |
| 717 |
|
* Get a key-value array of attributes |
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 Group_Field $this |
| 156 |
|
*/ |
| 157 |
|
public function set_label( $label ) { |
| 158 |
|
if ( is_null( $label ) ) { |
| 159 |
|
// Try to guess field label from it's name |
| 160 |
|
$label = Helper::normalize_label( $this->get_name() ); |
| 161 |
|
} |
| 162 |
|
$this->label = $label; |
| 163 |
|
return $this; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
/** |
| 167 |
|
* Label attribute getter. |