From 5c744829015c3f9826db3e2f93b777162df71846 Mon Sep 17 00:00:00 2001 From: Matth_eu Date: Wed, 11 Dec 2013 11:05:11 +0000 Subject: [PATCH] should still display group fields if values are empty --- classes.fields.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/classes.fields.php b/classes.fields.php index 0b05f2c1..8a14623e 100644 --- a/classes.fields.php +++ b/classes.fields.php @@ -1323,8 +1323,14 @@ public function display() { $this->title(); $this->description(); + // if there are no values and it's not repeateble, we want to do one with empty string + if ( ! $this->get_values() && ! $this->args['repeatable'] ) + $values = array( '' ); + else + $values = $this->get_values(); + $i = 0; - foreach ( $this->get_values() as $value ) { + foreach ( $values as $value ) { $this->field_index = $i; $this->value = $value;