Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
742 views
in Q2A Core by
edited by

Always wondered why we show custom user profile fields (like location, about me, etc.) if there is no value.

To hide these empty fields, you have to:

1. open qa-page-user.php

2. find line:
$qa_content['form_profile']['fields'][$userfield['title']]=array(
...
);

3. add a new line before: if($valuehtml!='' || qa_get_state()=='edit') {

4. add a new line at the end of the $qa_content block: } // closing if

 

---

FULL CODE BLOCK looks like this:

if($valuehtml!='' || qa_get_state()=='edit') {
    $qa_content['form_profile']['fields'][$userfield['title']]=array(
        'type' => $fieldsediting ? 'text' : 'static',
        'label' => qa_html($label),
        'tags' => 'NAME="field_'.$userfield['fieldid'].'"',
        'value' => $valuehtml,
        'error' => qa_html(@$errors[$userfield['fieldid']]),
        'rows' => ($userfield['flags'] & QA_FIELD_FLAGS_MULTI_LINE) ? 8 : null,
    );
}
 

Q2A version: 1.5.4
by
very helpful

Please log in or register to answer this question.

...