• cruelladeville

    (@cruelladeville)


    After a tip in this forum I checked out the remove_query_arg function, and I’ve managed to get it to work if I have only one GET-variable, but I have two. I tried several ways, either by calling the method twice, the first time with no variable to retrieve the return from the method,

    remove_query_arg('action',  $_SERVER['HTTP_REFERER']);
    $redirect = remove_query_arg('id', $_SERVER['HTTP_REFERER']);
    wp_redirect($redirect);

    the other by passing an array to the method.

    $redirect = remove_query_arg(array('id', 'action'),  $_SERVER['HTTP_REFERER']);
    wp_redirect($redirect);

    None is working. Tried to google for an example, but am only able to find with one variable to remove.

    Any ideas?

  • The topic ‘remove an array of get-variables’ is closed to new replies.