Skip to content

Commit f06ac40

Browse files
committed
added empty_message option
1 parent 6a3cfe3 commit f06ac40

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

fields/checkbox/checkbox.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public function render() {
3838
echo '<li><label><input type="checkbox" name="'. $this->field_name( '[]' ) .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
3939
}
4040
echo '</ul>';
41+
42+
} else {
43+
44+
echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
45+
4146
}
4247

4348
} else {

fields/radio/radio.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public function render() {
3737
echo '<li><label><input type="radio" name="'. $this->field_name() .'" value="'. $option_key .'"'. $this->field_attributes() . $checked .'/> '. $option_value .'</label></li>';
3838
}
3939
echo '</ul>';
40+
41+
} else {
42+
43+
echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
44+
4045
}
4146

4247
} else {

fields/select/select.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function render() {
6969
echo '</select>';
7070

7171
} else {
72-
echo esc_html__( 'No data provided for this option type.', 'csf' );
72+
73+
echo ( ! empty( $this->field['empty_message'] ) ) ? $this->field['empty_message'] : esc_html__( 'No data provided for this option type.', 'csf' );
74+
7375
}
7476

7577
}

0 commit comments

Comments
 (0)