Add calendar icon to field
Example removed.Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
Example removed.Continue reading
add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ if ($field_id == ‘field_FIELDKEY‘){ //change FIELDKEY to the key of your date field echo ‘,beforeShowDay: function(date){var day=date.getDay();return [(day != 2 && day != 4)];}’; } }Continue reading
add_filter(‘frm_replace_shortcodes’, ‘frm_change_my_html’, 10, 3); function frm_change_my_html($html, $field, $args){ if ( in_array ( $field[‘type’], array( ‘radio’, ‘checkbox’ ) ) ) { $temp_array = explode(‘/>’, $html); $new_html = ”; foreach ( $temp_array as $key => $piece ) { // Get current for…Continue reading
add_action(‘frm_field_input_html’, ‘add_input_html’); function add_input_html($field, $echo=true){ $html = ”; if($field[‘id’] == 25){ //change 25 to the ID of your field $html = ‘ required=”required”‘; } if($field[‘type’] == ‘number’){ $html = ‘ placeholder=”2″‘; } if($echo) echo $html; return $html; }Continue reading
add_action(‘frm_field_input_html’, ‘add_input_title’); function add_input_title( $field, $echo = true ) { $html = ”; if($field[‘type’] == ‘text’){ $html = ‘ title=”‘. esc_attr( $field[‘name’] ) .’”‘; } if($echo){ echo $html; } return $html; }Continue reading
add_filter(‘frm_recaptcha_lang’, ‘change_my_captcha_lang’, 10, 2); function change_my_captcha_lang($lang, $field){ if($field[‘id’] == 25) { //change 25 to the ID of the first captcha field to change $lang = ‘fr‘; //change this to the language code of your choice } return $lang; }Continue reading
add_filter(‘frm_field_classes’, ‘add_input_class’, 10, 2); function add_input_class($classes, $field){ if($field[‘id’] == 25){ //change 25 to the ID of your field $classes .= ‘ my_class’; } return $classes; }Continue reading
add_filter(‘frm_file_icon’, ‘frm_file_icon’, 10, 2); function frm_file_icon($html, $atts){ $image = $atts[‘image’]; $media_id = $atts[‘media_id’]; if ( $image && ! preg_match(“wp-content/uploads/”, $image) ) { //if this is a mime type icon $attachment = get_post($media_id); $label = basename($attachment->guid); $image .= ” <span id=’frm_media_$media_id’…Continue reading
add_action(‘frm_display_form_action’, ‘close_my_form’, 8, 3); function close_my_form($params, $fields, $form){ remove_filter(‘frm_continue_to_new’, ‘__return_false’, 50); if($form->id == 6){ //remove this section or change 6 to a form ID if(is_user_logged_in()){ echo ‘You are logged in’; add_filter(‘frm_continue_to_new’, ‘__return_false’, 50); } } }Continue reading
add_filter(‘frm_submit_button’, ‘change_my_submit_button_label’, 10, 2); function change_my_submit_button_label($label, $form){ $label = ‘New Submit Label’;//Change this text to the new Submit button label return $label; }Continue reading