Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This hook can be used to filter global setting values.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter( 'frm_global_setting', 'change_message' );
Parameters
- $setting (string) The current value of the string.
- $string (string) The name of the string to translate.
- $settings (object) FrmSettings.
Examples
Change a message in the global setting
add_filter( 'frm_global_setting', 'replace_global_setting', 10, 3 );
function replace_global_setting( $setting, $string, $settings ) {
$form_id = $settings->current_form;
if ( $form_id === 5 && $string === 'login_msg' ) { // change 5 to your form id and login&msg to the string name.
$setting = 'please log in'; // set the message here
}
return $setting;
}