Ok i made plugin for contact form, thing is i have redirection when form is submited to success page
$location = home_url().'/potvrda-prijave/';
wp_safe_redirect($location);
exit();
thing is when someone change permalinks structure i will get 404, does anybody knows how to grab permalinks change and change my redirection link? something like this
$location = home_url().'/potvrda-prijave/';
to
$location = home_url().'id=21';
Since you know the page ID, you can simply use get_permalink():
EDIT: It looks like you don’t actually know the ID…In that case, if you know the title, you can use:
However, if you’re using wp_insert_post() to create the post in the first place, that function returns the page ID of the added post. So: