Rewriting the pager of Views in Drupal 7 I have a Views which I am calling via views_get_view and view-&gt;preview. I am feeding the Views with a form via Form API - with no exposed filters - and the problem is that while the number of pages is correct, obviously, when I click on a page, I loose the POST variables and the pagination shows results which are not filtered. How can I rewrite the pager so I simply add as GET the parameters to the URL, so I can filter again when the user selects another page? I would prefer not to use exposed filters as I have some heavy PHP processing and would prefer just to make this modification which I would expect it to be easy but cannot find anything.
I found a way, by using the template_pager function in the template.php ( sites/all/themes/mytheme ) and modifying the core behaviour to this:

function template_pager($variables) {
    $tags = $variables['tags'];
    $element = $variables['element'];
    // next line is modified
    //$parameters = $variables['parameters'];
    $parameters = process_post();
    ...
 } // function template_pager

 function process_post(){
    // specific function
    $parameters = array();
    $parameters_sent = array("param1", "param2");
    foreach($parameters_sent as $key =&gt; $value){
    if(isset($_POST[$value]) ){
        if($_POST[$value] != ""){
            $parameters[$value] = $_POST[$value];
        }else{
            $parameters[$value] = 'all';
        } // if
    } // if
  } // if
  if(count($parameters) &gt; 0){
    return $parameters;
  }else{
    return NULL;
  } // if
} // function process_post