• Resolved mariusandersen

    (@mariusandersen)


    I have placed the submit form as a widget in the sidebar. After the user has successfully posted, and greeted with a “thank you for your post” I want him or her to be able to make a new post without having to go back to the previous page and refresh it or clicking a link to that page. Refreshing the current page doesn’t do anything and neither does the redirect (to the same page) it seems. It would be nice with a refresh (form) button displaying after a successful post saying something like “submit a new post”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help. That currently is a Pro feature, but I think it’s something that also should be included in the free version. I’ve added this to the to-do list and will try to implement in a future version of the plugin.

    In the meantime, you could add a link manually:

    <a href="#user-submitted-posts" onclick="window.location = window.location.href.split('?')[0];return false;">Submit a new post</a>

    That will reload the current page and remove the query parameters from the URL, so the form will be displayed fresh.

    Thread Starter mariusandersen

    (@mariusandersen)

    Thank you. So I suppose there is no simple way to just add this as an “echo” after

    if (isset($_GET[‘success’]) && $_GET[‘success’] == ‘1’) {…

    so it be visible only after a successful post and not all the time.

    I am a beginner in terms of php, so no need for an elaborate answer. I can wait for the update or even purchase the pro version, but this is the only function that I really missed.

    Appreciate it.

    Plugin Author Jeff Starr

    (@specialk)

    The code I provided is HTML, so can be added directly to a widget. The code you suggest is PHP, and must be included in an actual PHP file. So not something that can be added via widget. Of course, if you are able to edit theme files (i.e., work with PHP), then much more can be done in terms of when/where/how things are displayed and so forth.

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up, the next version of User Submitted Posts features a “reset form” shortcode that looks like this:

    [usp-reset-button url="https://example.com/submit/"]

    Thank you for the feedback on this idea.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Submit new post after a successful post’ is closed to new replies.