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 change the labels in Address fields and Credit Card fields.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter('frm_combo_dropdown_label', 'add_cc_labels', 10, 2 ); function add_cc_labels( $label, $atts )
Parameters
- $label (string)
- $atts (array)
Examples
Set Month and Year Placeholder for Credit Card field
The following example will produce placeholders for the dropdown fields in a Credit Card field. Specifically, the Month and Year dropdown fields will read "Month" and Year".
add_filter('frm_combo_dropdown_label', 'add_cc_labels', 10, 2 );
function add_cc_labels( $label, $atts ) {
if ( $atts['key'] == 'month' ) {
$label = 'Month';
} elseif ( $atts['key'] == 'year' ) {
$label = 'Year';
}
return $label;
}