Skip to content

Instantly share code, notes, and snippets.

@wpmudev-sls
Last active May 30, 2024 13:10
Show Gist options
  • Save wpmudev-sls/6db25a02f3a72992f64823af7cacba59 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/6db25a02f3a72992f64823af7cacba59 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Redirect user to own site after activation
<?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