• When showing single participant I want to exclude empty fields so that the field title also doesn’t appear but I couldn’t figure out what syntax I should use. In pdb-single-default.php I’ve tried something like
    if (in_array( $this->field->name.value, "") ) continue;
    but that’s not correct of course.

    https://wordpress.org/plugins/participants-database/

Viewing 1 replies (of 1 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Well there are several ways to do this, of course, but a simple check for an empty value would be:

    if ( $this->field->value === '' ) {
      continue;
    }

    It’s also possible to use CSS to hide empty fields. If you look at the HTML of the default template, you’ll see that empty fields have a special classname so you can hide them if you want:

    .blank-field {
      display:none;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude empty fields’ is closed to new replies.