Last active
December 11, 2020 18:31
-
-
Save jg314/5299d64d073c6d3e0a67 to your computer and use it in GitHub Desktop.
Events Calendar Community Events: Redirect users to a new page after submission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Send visitors who submit events to a different page after submission. | |
* | |
* This actually does the redirect. If an event was submitted, and we're about | |
* to reload the submission page (with a message instead of a form), this will | |
* redirect the user. | |
* | |
* @param WP $wp | |
* @return void | |
*/ | |
function wi_redirect_after_community_submission( $wp ) { | |
if ( isset($wp->query_vars[WP_Router::QUERY_VAR]) && $wp->query_vars[WP_Router::QUERY_VAR] == 'ce-add-route' && !empty($_POST) ) { | |
wp_safe_redirect( get_permalink( 7607 ) ); // Use the Post ID of the page you want to redirect people to | |
exit(); | |
} | |
} | |
/** | |
* If a new community event was created add an action to send people to a custom thank you page. | |
*/ | |
function wi_check_for_community_submission() { | |
add_action( 'parse_request', 'wi_redirect_after_community_submission', 11, 1 ); | |
} | |
add_action( 'tribe_community_event_created', 'wi_check_for_community_submission' ); |
I'm sorry it's not working for you @MarkMetz00. Can you tell me what's happening for you with the code? Are you getting an error or is nothing happening at all?
Suddenly it's not working I think me updated the event calendar community
plugin it's goes to by default page not any error can you help me please
with new version many thanks
…On Thu, Dec 10, 2020, 7:51 PM Jonathan Goldford ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I'm sorry it's not working for you @MarkMetz00
<https://github.com/MarkMetz00>. Can you tell me what's happening for you
with the code? Are you getting an error or is nothing happening at all?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/5299d64d073c6d3e0a67#gistcomment-3556943>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASCIZW5RW742QO4S555I2DDSUDN53ANCNFSM4UVDIX4A>
.
I tested it this morning with The Events Calendar PRO plugin version 5.2.0 and The Events Calendar: Community Events plugin version 4.8.2. It worked as expected. If those plugins are updated for you, then it may be something with your theme or another plugin that's causing the issue. Since these are paid plugins you might also consider reaching out to their support team for help. Good luck getting it resolved.
I have both same version avada theme new version update I think it's not
work can you help me about avada theme
…On Fri, Dec 11, 2020, 7:09 PM Jonathan Goldford ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I tested it this morning with The Events Calendar PRO plugin version 5.2.0
and The Events Calendar: Community Events plugin version 4.8.2. It worked
as expected. If those plugins are updated for you, then it may be something
with your theme or another plugin that's causing the issue. Since these are
paid plugins you might also consider reaching out to their support team for
help. Good luck getting it resolved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/5299d64d073c6d3e0a67#gistcomment-3558132>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASCIZW4MAAIVRGHG5QPF5TTSUIR3NANCNFSM4UVDIX4A>
.
I'd definitely recommend reaching out to The Events Calendar support team. They are much better equipped to help you than I would be. Good luck getting it resolved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i am using this one and its not working on new version can you update pls