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.
Adjust the standard value shown in the email, entries page, or views. The name of the hook will changed based on the type of field being displayed.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter( 'frm_display_text_value_custom', 'adjust_text_value', 10, 2 ); function adjust_text_value( $value, $args ) {
Parameters
- $value (string or array) - The value to be displayed
- $args (array)
- $args['field'] (object) - The field being displayed
- $args['entry'] (object) - The entry that is being displayed
Examples
Format an email address
Switch a displayed email address to a mailto link.
add_filter( 'frm_display_email_value_custom', 'frm_email_val', 15, 2 );
function frm_email_val( $value, $atts ) {
if ( $atts['field']->id == 500 ) { // Change 500 to the ID of your email field
$value = '<a href="mailto:' . $value . '">' . $value . '</a>'; //change the value here
}
return $value;
}