zakii
asked 6 years ago

How Remove “put email” when ask new question in DWQA ?

4 Answers
DominicStaff
answered 6 years ago

To resolve this issue, you can open the Handle.php file in the inc folder then remove the line 49 to 51and open the question-submit-form.php file in the templates folder then remove line 51to 55.

eldar
replied 6 years ago

Not help. This action deletes the entire site. How can I delete this email?

Dominic Staff
replied 6 years ago

Which version are you using?
You should find and remove the following code in this file.

<p>
<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="<?php echo sanitize_email( $email ) ?>" >
</p>

Pedroptz
replied 4 years ago

Hello Dominic.

So in the Handle file we delete the following code:

” if ( !is_user_logged_in() && ( empty( $_POST[‘user-email’] ) || !is_email( sanitize_email( $_POST[‘user-email’] ) ) ) ) {
dwqa_add_notice( __( ‘Missing email information’, ‘dw-question-answer’ ), ‘error’ );”

And in question-submit-form.php we delete the following code:

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

Right? Thank you!

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>
Pedroptz
replied 4 years ago

Thank you very much for the helpful response.

Pedroptz
answered 4 years ago

Dear Dominic,
 
Where should I copy that code into?
 
What file?
 
I’ve copied it to the question-submit-form, but the email missing warning is still coming up.
 
Thank you

Pedroptz
answered 4 years ago

I did it!
 
Copied into:
 
<?php if ( dwqa_current_user_can( ‘post_question’ ) && !is_user_logged_in() ) : ?>
        <p>
            <label for=”_dwqa_anonymous_email”><?php _e( ‘Your Email’, ‘dw-question-answer’ ) ?></label>
            <?php $email = isset( $_POST[‘_dwqa_anonymous_email’] ) ? sanitize_email( $_POST[‘_dwqa_anonymous_email’] ) : ”; ?>
            <input type=”email” class=”” name=”_dwqa_anonymous_email” value=”<?php echo $email ?>” >
        </p>
        <p>
            <label for=”_dwqa_anonymous_name”><?php _e( ‘Your Name’, ‘dw-question-answer’ ) ?></label>
            <?php $name = isset( $_POST[‘_dwqa_anonymous_name’] ) ? sanitize_text_field( $_POST[‘_dwqa_anonymous_name’] ) : ”; ?>
            <input type=”text” class=”” name=”_dwqa_anonymous_name” value=”<?php echo $name ?>” >
        </p>
          <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>
        <?php endif; ?>

Dominic Staff
replied 4 years ago

You should replace the older code with the code that I have provided in previous answer.
If you still face their issue, you can send me username & password of your site for further checking.

Powered by DW Question & Answer Pro