Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    just to make sure I understand the issue, what you’ve wanted to do is redirect user to the same event she creating after clicking on the submit button for editing, is this correct? also not sure if this helps but maybe you can try this thread and modify if needed – https://www.ads-software.com/support/topic/savingupdating-eventlocation-redirects-to-default-lang-filter-needed?replies=13

    Thread Starter efoula

    (@efoula)

    Hello Angelo,

    Thanks for your reply. I will explain more, when a user use the edit form (front-end) to edit an event then submit (to update), it redirects the user to the same page of the edit form, but I want to redirect the user to the single page of the event (post) that he/she has edit.

    I have found a php solution, but I should to edit in the plugin’s files, but I don’t want to do this because of it will be changed when I update the plugin later.

    I checked out the link you have send above before, but this issue is a qTranslate redirecting troubleshoot, not the same of my problem.

    Thank you, and I hope you got it.
    Best,
    EF.

    Thread Starter efoula

    (@efoula)

    Hello again,

    Angleo, open the plugin root (/templates/forms), you’ll find a file named as (event-editor.php), open this file and find this line of code

    <input type="hidden" name="redirect_to" value="<?php echo esc_attr($_REQUEST['redirect_to']); ?>" />

    , the value of the input is to redirect to the same page (edit page), this exactly what I want to change. The simple solution is to get the event (post) id of the current event that the user try to edit and when the user click the submit button, redirect him/her to the single event page by the id you have got (ex. post=274) or by getting the post slug throw it’s id (ex. events/example-event).

    I know how to do this by editing the (event-editor.php) file, but I want to do this throw my (functions.php) file or even throw jQuery.

    Thanks again.
    Best,
    EF.

    Hiya,

    The first thing you need to do is change the setting at Events > Settings > General > Event Submission Forms > Show form again?

    Then, you’ll need a bit of custom coding to do the actual redirect. You’ll need to find a hook in an appropriate place where you can use wp_redirect().

    I had a quick look but couldn’t immediately see a good hook to use so you might need to do some digging.

    Thanks

    Efoula’s solution is the way to go. I have a redirect after a submission too. Just find in yourtheme/plugins/event-manager/forms/event-editor.php

    <?php if( !empty($_REQUEST['redirect_to']) ): ?>
    <input type="hidden" name="redirect_to" value="<?php echo esc_attr($_REQUEST['redirect_to']); ?>" />
    <?php endif; ?>

    and replace it with:

    <?php
     $redirect_to = site_url();
    ?>
    <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect page after edit event’ is closed to new replies.