Péter Frucht
asked 9 years ago

Hi there,

we are creating a website for streetworkers in Berlin. The site should offer the possibility for youngsters to get information about drug usage, to get answers to their questions about drugs. This people really need help and are frightened to ask questions when their identity is becoming public.

We think your plugin "DW Question & Answer" is really the best solution for this drug information service. Is there a possibility to hide the Email field and not use it when people ask a question?

This would be a very important for us to make this service work.

Kind regards
Péter

3 Answers
DominicStaff
answered 9 years ago

Hi,
To remove the email section when anonymous ask a question, you can open the \wp-content\plugins\dw-question-answer\inc\template-functions.php file. Find the line 112, 113 then remove the following code:

<label for="user-email" title="<?php _e( 'Enter your email to receive notification regarding your question. Your email is safe with us and will not be published.','dwqa' ) ?>"><?php _e( 'Your email *','dwqa' ) ?></label> 
<input type="email" name="_dwqa_anonymous_email" id="_dwqa_anonymous_email" class="large-text" placeholder="<?php _e( 'Email address ...','dwqa' ) ?>" required> 

Hope this helps !

colorfox
replied 9 years ago

Thank you for your quick reply. I have applied the proposed changes, which makes our service as we wished.
Great plugin! Great service!

Pedroptz
answered 4 years ago

I can’t seem to find the path that was mentioned.
I only have “\wp-content\plugins\dw-question-answer\inc\"
What should I do?

Pedroptz
replied 4 years ago

I found this code

<input type="email" class="" name="_dwqa_anonymous_email" value="” >

Should I remove it? It’s in file “question-submit-form”

DominicStaff
answered 4 years ago

At the moment, you can not remove this fields. The fields specifies that an input field must be filled out before submitting the form.
In this case, you can use the following code:


        <p style="display: none;">
            <label for="_dwqa_anonymous_email"><?php _e( 'Your Email', 'dwqa' ) ?></label>
            <?php $email = isset( $_POST['_dwqa_anonymous_email'] ) ? $_POST['_dwqa_anonymous_email'] : ''; ?>
            <input type="email" class="dwqa-question-anonymous-email" name="_dwqa_anonymous_email" value="[email protected]" readonly>
        </p>
        <p style="display: none;">
            <label for="_dwqa_anonymous_name"><?php _e( 'Your Name', 'dwqa' ) ?></label>
            <?php $name = isset( $_POST['_dwqa_anonymous_name'] ) ? $_POST['_dwqa_anonymous_name'] : ''; ?>
            <input type="text" class="dwqa-question-anonymous-name" name="_dwqa_anonymous_name" value="Anonymous" readonly>
        </p>
Powered by DW Question & Answer Pro