Last active
May 30, 2024 13:10
-
-
Save wpmudev-sls/6db25a02f3a72992f64823af7cacba59 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Redirect user to own site after activation
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 | |
/** | |
* Plugin Name: [Forminator Pro] Redirect user to own site after activation | |
* Description: Redirect user to own site after activation. | |
* Author: Prashant @ WPMUDEV | |
* Task: SLS-6183 | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
add_action( 'forminator_cform_site_created', 'wpmudev_redirect_to_user_subsite', 10, 5 ); | |
function wpmudev_redirect_to_user_subsite( $blog_id, $user_id, $entry, $custom_form, $password ) { | |
if ( empty( $blog_id ) ) { | |
return; | |
} | |
$redirect_url = get_site_url( $blog_id ); | |
wp_redirect( $redirect_url ); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment