Created
June 19, 2025 07:35
-
-
Save finalwebsites/cfa29890cc47afee6ee754194e4759b4 to your computer and use it in GitHub Desktop.
Use two WCAPF forms based on the chosen language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function retrieve_form() { | |
global $wcapf_form; | |
if ( ! $wcapf_form ) { | |
return array(); | |
} | |
$desired_form = array(); | |
$taal = pll_current_language(); | |
foreach ( $wcapf_form as $form ) { | |
if ( empty( $form['rendered'] ) ) { | |
if ($taal == 'en') { | |
if ($form['form_title'] == 'English') { | |
$desired_form = $form; | |
break; | |
} | |
} elseif ($taal == 'nl') { | |
if ($form['form_title'] == 'Nederlands') { | |
$desired_form = $form; | |
break; | |
} | |
} else { | |
$desired_form = $form; | |
break; | |
} | |
} | |
} | |
return $desired_form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment