Hello, I liked your plugin.
I would like to ask. How to make the selection field “category” has become a must for selection.
I have two categories on the site and the shortcode [dwqa-list-questions category = “male”] and [dwqa-list-questions category = “female”] on two pages displaying items for categories of male and female.
When submitting a question, if a person does not choose a category, then the issue is not visible in the list.
Can you help?
You can open file wp-content/plugins/dwqa-question-answer/inc/Handle.php
and add following code from line 293:
if ( !$category ) { dwqa_add_notice( __( ‘You must choose category.’, ‘dwqa’ ), ‘error’ ); return false; } if ( !is_user_logged_in() && empty( $_POST[‘_dwqa_anonymous_email’] ) && !is_email( $_POST[‘_dwqa_anonymous_email’] ) ) { dwqa_add_notice( __( ‘You must enter a valid email.’ ), ‘error’ ); return false; }
1-ask, 1-answer ?((
Added code unfortunately writes an error on the page:
Parse error: syntax error, unexpected ‘must’ (T_STRING), expecting ‘,’ or ‘)’ in / home / host1452973 / site / htdocs / www / wp-content / plugins / dw-question-answer / inc / Handle. php on line 294
I do not do right?
Please send me username & password of your site, I will help you resolve it.
Please login or Register to submit your answer