0

I'm using wp_redirect to send the user back to an admin page. Everything works fine expect for the get variable that gets removed for some reason.

    $url = "admin.php?page=cv_data&saved";
    wp_redirect(admin_url($url));

Redirects fine to

admin.php?page=cv_data&saved

half a second later the url loses the "saved" variable.

admin.php?page=cv_data

I was trying to use that "saved" get variable to trigger some CSS and give some feedback to the user that the form was saved.

I tried giving the variable a value like &saved=1. Still lose it.

0

Well.. I got it working.

Even though the URL loses the GET variable, its still set and working. A simple if(isset($_GET["saved"])) returns true and I can keep doing what i intended.

The fact that the variable appears and disappears in seconds from the URL confused me.

¯|_(ツ)_|¯

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.