Custom actions before and after adding a question

4.08K viewsGeneral
0

I need to implement custom actions before and after adding a questions by user.

1. Before posting a question I need my user to enter some data on my custom page. After he does this I need to redirect him to question add form and this data should be reflected in form fields.

2. After he submits the form to publish a questions, again, i need to redirect him to my custom page and do some things there and only after that redirect him to question page.

Which hooks/templates in AnsPress should I use to achieve this?

0

Hello,

First one is easy, create a new page with your custom field and from here redirect user to AnsPress ask page.

for 2nd, you have to use ap_ajax_responce filter. check if success is true and action is new_question. Then update redirect url to your desired location.

Cheers.