Redirect to New Post | WordPress.org

[ad_1]

Not sure why itโ€™s happening but resolved it with preg_replace ๐Ÿ™‚ ..

add_action( 'forminator_post_data_field_post_saved', function( $post_id ){
	$_POST['forminator_post_id'] = $post_id;
	add_filter( 'forminator_replace_form_data', function( $content, $data, $fields ){
		if( ! empty( $_POST['forminator_post_id'] ) && false !== strpos( $content, '[post_url]' ) ){		
			$link = preg_replace('#^https?://#i', '', get_permalink( $_POST['forminator_post_id'] ));
			$content = str_replace( '[post_url]', $link, $content );
		}
		return $content;
	}, 10, 3 );
} );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer