我想根据重力形式的条件重定向。
//REDIRECT BASED ON GRAVITY SELECTIONS
add_filter( \'gform_confirmation_17\', __NAMESPACE__ . \'\\\\redirectfilter\', 10, 4 );
function redirectfilter($confirmation, $form, $entry, $ajax) {
GFCommon::log_debug( __METHOD__ . \'(): started.\' );
session_start();
$laatste = $entry[\'1\'];
if(isset($_SESSION[\'form\'])) {
GFCommon::log_debug( __METHOD__ . \'(): SESSION[form] is set.\' );
$result = array();
foreach($_SESSION[\'form\'] as $row){
$result[] = $row;
}
if ($result[0] === \'Diesel\' && $result[1] === \'Mobiel\' && $laatste === \'Kunststof\' ) {
GFCommon::log_debug( __METHOD__ . \'(): Diesel and Mobiel and Kunststof\' );
$confirmation = array(\'redirect\' => esc_url(home_url(\'/producten/filters/brandstof/diesel/materiaal/kunststof/toepassing-filter/mobiel/\')));
} else {
$confirmation = "Geen producten gevonden aan jouw criteria";
}
}
GFCommon::log_debug( __METHOD__ . \'(): finished.\' );
return $confirmation;
}
但我似乎无法让它发挥作用,我觉得我错过了什么,但我找不到:/
你可以在这里找到我的重力表日志:http://pastebin.com/hm5RYpyZ.
非常感谢您的帮助。
顺致敬意,
迪伦·斯密特