Revision of 建立內容後跳轉到指定 URL from Sun, 2012-12-02 00:18

我突然在需要使用的時候發現我竟然沒有寫下:

<?php
/**
 * hook_form_alter()
 */
function hook_form_alter(&$form, &$form_state)
{
 
// callback
 
$form['actions']['submit']['#submit'][] = 'custom_checkin_redirect';
}
/**
 * callback
 */
function custom_checkin_redirect($form, &$form_state)
{
 
$form_state['redirect'] = 'check-in'; // any url works here
}
?>
Google