• Resolved alfredogorga

    (@alfredogorga)


    Hi! I need to remove the “required” text next to each of my form’s required fields, it’s a short form and I prefer to put an “All fields required” notice instead.

    #1 I installed the “Code Snippets” plugin by Shea Bunge
    #2 I added this hook, found at https://bit.ly/2sYjJHE, to customize the form:

    function jetpackcom_custom_required() {
    return __( ‘This is important, you must fill it in.’, ‘plugin-textdomain’ );
    }
    add_filter( ‘jetpack_required_field_text’, ‘jetpackcom_custom_required’ );

    Works well but “forces” me to use some text to replace the “required” wording.
    Is there a way not to use any text? I thought about using an asterisk but as said before I prefer to just place a single notice for all fields.

    Thanks for your help.

Viewing 1 replies (of 1 total)
  • Hi there,

    You can just remove the text completely to return an empty string, like so:

    function jetpackcom_custom_required() {
    return __( ‘’, ‘plugin-textdomain’ );
    }
    add_filter( ‘jetpack_required_field_text’, ‘jetpackcom_custom_required’ );

    And then add the required message either before or after your contact form.

Viewing 1 replies (of 1 total)
  • The topic ‘Help to customize contact form.’ is closed to new replies.