Home › Forums › ACF PRO › verify get_field value and redirect to a page › Reply To: verify get_field value and redirect to a page
Hello, you can try something like:
<?php
$model_name = get_field('model_name');
switch ($model_name) {
case 'iphone':
/* if no page output / print / echo to this function */
$redirect = "http://www.yourlinkredirect.com";
header("location:$redirect");
break;
case 'samsung':
/* with javascript help */
echo '<script language="JavaScript">
window.location="http://www.yourlinkredirect.com";
</script> '
break;
case 'others':
/* ... */
break;
}
?>
I hope that helps, hug…
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.