• Resolved moacirsantana

    (@moacirsantana)


    Hello, for those who want a custom button text, here’s a workaround that I got working that can help you customize your buttons.

    Step #1
    Wrap your group field in a div or span (in this case, use add_new):

    <div class=”add_new”>
    [field_group mensagens id=”grupo-mensagem” tabindex:1]
    [textarea your-message]
    [/field_group]
    </div>

    Then add the code below to your CSS:
    /* Custom Button Text */
    .add_new .wpcf7-field-group button.wpcf7-field-group-add:after {content: ‘ Add new’;}
    .add_new .wpcf7-field-group button.wpcf7-field-group-remove:after {content: ‘ Remove’;}
    /* End Custom Button Text*/

    By using a div or span with a specific Class, you can add different texts for group fields.

    PrintScreen: https://snag.gy/EkR09S.jpg

    Hope it helps

    • This topic was modified 6 years, 2 months ago by moacirsantana.
Viewing 1 replies (of 1 total)
  • Plugin Author Felipe Elia

    (@felipeelia)

    Hi, thanks for sharing that!

    You can also use the wpcf7_field_group_add_button_atts and wpcf7_field_group_remove_button_atts WP filters, like this:

    function mytheme_wpcf7_field_group_add_button_atts( $atts ) {
    	$atts['text'] = 'Add New';
    	return $atts;
    }
    add_filter( 'wpcf7_field_group_add_button_atts', 'mytheme_wpcf7_field_group_add_button_atts' );
    
    function mytheme_wpcf7_field_group_remove_button_atts( $atts ) {
    	$atts['text'] = 'Remove';
    	return $atts;
    }
    add_filter( 'wpcf7_field_group_remove_button_atts', 'mytheme_wpcf7_field_group_remove_button_atts' );

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Button Text’ is closed to new replies.