$v = empty( $value->mParams['nodata'] )
? $this->mFieldData[$key]
: $value->getDefault();
- $html[] = $value->$getFieldHtmlMethod( $v );
- $labelValue = trim( $value->getLabel() );
- if ( $labelValue != ' ' && $labelValue !== '' ) {
- $hasLabel = true;
- }
+ $retval = $value->$getFieldHtmlMethod( $v );
+
+ // check, if the form field should be added to
+ // the output.
+ if ( $value->hasVisibleOutput() ) {
+ $html[] = $retval;
+
+ $labelValue = trim( $value->getLabel() );
+ if ( $labelValue != ' ' && $labelValue !== '' ) {
+ $hasLabel = true;
+ }
- if ( get_class( $value ) !== 'HTMLHiddenField' &&
- get_class( $value ) !== 'HTMLApiField'
- ) {
$hasUserVisibleFields = true;
}
} elseif ( is_array( $value ) ) {
return call_user_func_array( $callback, $args );
}
+ /**
+ * If this field has a user-visible output or not. If not,
+ * it will not be rendered
+ *
+ * @return bool
+ */
+ public function hasVisibleOutput() {
+ return true;
+ }
/**
* Fetch a field value from $alldata for the closest field matching a given