Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active May 24, 2018 13:37
Show Gist options
  • Select an option

  • Save kjohnson/8fad46bb7e7237dfc6b81a873026ff6f to your computer and use it in GitHub Desktop.

Select an option

Save kjohnson/8fad46bb7e7237dfc6b81a873026ff6f to your computer and use it in GitHub Desktop.
<?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 );
}
});
<?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 );
}
});
<?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