At last ask question page is ready,
Here is the screenshot:
Added an easy method for form validation and sanitzation,
Here is an example:
$args = array( 'title' => array( 'sanitize' => array('sanitize_text_field'), 'validate' => array('required' => true, 'length_check' => ap_opt('minimum_qtitle_length')) ), 'description' => array( 'validate' => array('required' => true, 'length_check' => ap_opt('minimum_question_length')) ), 'is_private' => array( 'sanitize' => array('only_boolean') ), ); $validate = new AnsPress_Validation($args); var_dump($validate->get_sanitized_fields()); var_dump($validate->get_errors());
Hi, bravo for great design , how can activate register form as a new visitor? i don’t know if i miss something at solved questions. HAPPY NEW YEAR!
Added advance form system in AnsPress 2.0. Now it will be much easier to add new fields or modify existing form fields.
Now you can use filters to modify or add new fields.
Here is an example
$args = array( 'name' => 'ask_form', 'is_ajaxified' => true, 'fields' => array( array( 'name' => 'title', 'label' => __('Title', 'ap'), 'type' => 'text', 'placeholder' => __('Question in once sentence', 'ap'), 'value' => sanitize_text_field(@$_POST['title'] ) ), array( 'name' => 'category', 'label' => __('Category', 'ap'), 'type' => 'taxonomy_select', 'value' => sanitize_text_field(@$_POST['category'] ), 'taxonomy' => 'question_category' ), array( 'name' => 'is_private', 'label' => __('Private', 'ap'), 'type' => 'checkbox', 'desc' => __('This question ment to be private, only visible to admin and moderator.', 'ap'), 'value' => sanitize_text_field(@$_POST['is_private'] ) ), ), ); $form = new AnsPress_Form($args); echo $form->get_form();
At last user profile page is completed.
After doing some more little fix and I will release first preview of 2.0
Hi,
Please advice.
I have active social login and all API done but none of login button coming on ask/question page automaticly.
I have managed to add in ask page but i would like to add within login or signup box.
Can you please let me know HowTo add within inside of the ask and question page/all login boxes like attached: https://www.dropbox.com/s/9pih3ducaaqdoy7/Screen%20Shot%202014-12-31%20at%2011.02.00.png?dl=0
check my site its not within inside of the post : http://goo.gl/3vYtHZ
Currently the user is only prompted to register ‘after’ they have typed out their question only to lose the question after registering. Is there a way to store the content of the question so they don’t lose it?
Just a suggestion but it would be great if new questions could be automatically sent as a tweet with a link back. Possible?
Rahul, is there a way to expose a link to a user’s Favorite questions page within their user profile that can be added to the site’s main navigation menus?
I’m using the Make theme from Theme Foundry and when creating sections on a page unrelated to AnsPress I’m getting this error:
Warning: Missing argument 2 for anspress_theme::the_title() in /home/domain/public_html/mysite.com/wp-content/plugins/anspress-question-answer/includes/anspress-theme.php on line 120
In looking into the file, I see that you are using a public function called the_title() – using this function appears to be causing some problems elsewhere outside of AnsPress. This is a rather generic function name.
Can you look into this please?