WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Unset $_GET-variables after action is done (2 posts)

  1. cruelladeville
    Member
    Posted 9 years ago #

    I've made a plugin to display a random profile image in my sidebar. In my option panel I've made a page where the user can upload a photo and also delete existing images.
    The deletion of images sends parameters via $_GET, but after the deletion I'd like to send the user back to the plugin page without the get-variables in the url (this causes an error, since the file is already deleted).

    How can I solve this?
    I tried with headers, but the admin page sends output before my page is loaded.

  2. Austin Matzko
    Member
    Posted 9 years ago #

    You should check out WordPress's remove_query_arg function, which allows you to specify a $_GET parameter to remove. You could pass the server request variable through it to get your result.

Topic Closed

This topic has been closed to new replies.

About this Topic