Skip to content

Instantly share code, notes, and snippets.

@dry
Last active December 23, 2015 12:39
Show Gist options
  • Save dry/6636840 to your computer and use it in GitHub Desktop.
Save dry/6636840 to your computer and use it in GitHub Desktop.
Remove show message redirect from Cookie Consent module
<?php
// ... rest of module stuff
/**
* Set the 'cookies_allowed' cookie
*
* @access public
* @return string
*
*/
public function set_cookies_allowed()
{
$this->EE->lang->loadfile('cookie_consent');
$expires = 60*60*24*365; // 1 year
$this->EE->functions->set_cookie('cookies_allowed', 'y', $expires);
$ret = ($this->EE->input->get('RET')) ? $this->EE->input->get('RET') : '';
$return_link = $this->EE->functions->create_url($ret);
/* Remove the message redirect completely
// Send them a success message and redirect link
$data = array(
'title' => lang('cookies_allowed'),
'heading' => lang('cookies_allowed'),
'content' => lang('cookies_allowed_description'),
'redirect' => $return_link,
'link' => array($return_link, lang('cookies_return_to_page')),
'rate' => 3
);
$this->EE->output->show_message($data);
*/
// Immediately send user to the correct URL
$this->EE->functions->redirect($return_link);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment