miejska
asked 8 years ago

Without email validation for anonymous user?
I wanted change template-functions.php (I found information about this in older post – delete line 111,112 in template-functions.php) Unfortunately I don’t have this file in my version DWQ&A 1.4.5.
What can I do? This very important for me. 
Thanks!
PS
I need this because plugin is amazing!

4 Answers
Kevin
answered 8 years ago

Hi,

You can go to wp-content/plugins/dw-question-answer/inc/Handle.php then remove the code from line 298 to 398

if ( !is_user_logged_in() ) {
	if ( empty( $_POST['_dwqa_anonymous_email'] ) || !is_email( sanitize_email( $_POST['_dwqa_anonymous_email'] ) ) ) {
		dwqa_add_notice( __( 'Missing email information', 'dwqa' ), 'error' );
		return false;
	}

	if ( empty( $_POST['_dwqa_anonymous_name'] ) ) {
		dwqa_add_notice( __( 'Missing name information', 'dwqa' ), 'error' );
		return false;
	}
}
miejska
answered 8 years ago

Thanks Kevin! I removed the code from line 298 to 308:) but when I add answer as anonymous user I still have to entering email;/
In case add new question – it’s working fine.
Thanks for Your patience

Kevin
answered 8 years ago

Hi,

You can remove the code from line 49 to 55 in the file Handle.php

if ( !is_user_logged_in() && ( empty( $_POST['user-email'] ) || !is_email( sanitize_email( $_POST['user-email'] ) ) ) ) {
	dwqa_add_notice( __( 'Missing email information', 'dwqa' ), 'error' );
}

if ( !is_user_logged_in() && ( empty( $_POST['user-name'] ) ) ) {
	dwqa_add_notice( __( 'Missing name information', 'dwqa' ), 'error' );
}
miejska
answered 8 years ago

I owe you one Kevin.
Thanks for your help
Best Regards
 

Powered by DW Question & Answer Pro