• Hi,

    Thank you for sharing your work.

    I have this project where I want to add the question form in a sidebar and have the user submit the question without redirecting to the question after submit. Is it possible to have a success message after submit without redirecting to the question page? I need the user to stay on the same page.

    Also: I see there’s a _wp_http_referer hidden field but I don’t see the referal URL anywhere. Where is this data supposed to be?

    Thanks.

    álvaro

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author DesignWall

    (@designwall)

    Hi,
    Firstly, you can make the Q&A auto-redirect to another page after submitting a question.

    – You can open the Handle.php file find the line 482.

    dwqa_add_notice( __( 'Your question is waiting moderator.', 'dwqa' ), 'success' );
    Then replace with the following code to redirect to home page:
    exit( wp_safe_redirect( home_url() ) );

    Notice: you can use similar to redirect user to any other page as you wish (in your case to the question listing page)

    Eg: like this is my url : https://mysite/discussion-forum/
    exit( wp_safe_redirect( home_url() .'/discussion-forum/' ) );

    – You can add the content to this page.
    Regards,
    DesignWall Team.

    Thread Starter Alvaro Gois dos Santos

    (@alvarogois)

    Hi,

    Thank you for your answer.

    What if I don’t want any redirection? I want the user to stay on the same page.

    And what happens if there’s a plugin update? Could this change be made in a way it’s update-proof?

    Best
    álvaro

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Don’t redirect to question after submit’ is closed to new replies.