Last active
May 24, 2018 13:37
-
-
Save kjohnson/8fad46bb7e7237dfc6b81a873026ff6f to your computer and use it in GitHub Desktop.
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 | |
| add_action( 'nf_get_form_id', function( $form_id ) { | |
| if( '12' == $form_id ) { | |
| $recaptcha_lang = 'en'; | |
| Ninja_Forms()->update_setting( 'recaptcha_lang', $recaptcha_lang, true ); | |
| } | |
| }); |
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 | |
| add_action( 'init', function() { | |
| if( true ){ // Some condition to change the language. | |
| $recaptcha_lang = 'en'; | |
| Ninja_Forms()->update_setting( 'recaptcha_lang', $recaptcha_lang, true ); | |
| } | |
| }); |
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 | |
| /** | |
| * Update the `recaptcha_lang` setting. | |
| * | |
| * @param string $setting_key | |
| * @param string $new_value | |
| * @param bool $defer_update True will update the value in memeory, but will not update the database. | |
| */ | |
| Ninja_Forms()->update_setting( 'recaptcha_lang', $recaptcha_lang, true ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment