• Resolved mcaso

    (@mcaso)


    Hello

    I am developed a site and I would like to add some custom fields in my form. I took the first part of the code from one example ( see below) using the plugin my custom function. But unfortunately it leads me to a error ( 500)
    Can you please help me with that.

    Thanks a lot in advance
    Marcela

    function give_myprefix_custom_form_fields( $form_id ) {
    // Only display for forms with the IDs “754” and “578”;
    // Remove “If” statement to display on all forms
    // For a single form, use this instead:
    // if ( $form_id == 754) {
    $forms = array( 73, 488 ); ?>
    <div id=”give-referral-wrap”>
    <label class=”give-label” for=”give-referral”><?php _e( ‘How did you hear about GDI?:’, ‘give’ ); ?> <span class=”give-tooltip icon icon-question” data-tooltip=”<?php _e( ‘Please take a second to tell us how you first heard about Girl Develop It.’, ‘give’ ) ?>”></span>
    </label>
    <textarea class=”give-textarea” name=”give_referral” id=”give-referral”></textarea>
    </div>
    <?php endif;

    }
    add_action( ‘give_after_donation_levels’, ‘give_myprefix_custom_form_fields’, 10, 1 );

Viewing 1 replies (of 1 total)
  • Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi there,

    Our support does not typically cover custom code, but this should get you going on the right track:

    function give_myprefix_custom_form_fields( $form_id ) {
    	?>
    
    	<div id="give-referral-wrap">
    		<label class="give-label" for="give-referral"><?php _e( 'How did you hear about GDI?:', 'give' ); ?>	<span class="give-tooltip icon icon-question" data-tooltip="<?php _e( 'Please take a second to tell us how you first heard about Girl Develop It.', 'give' ) ?>"></span>
    		</label>
    		<textarea class="give-textarea" name="give_referral" id="give-referral"></textarea>
    	</div>
    <?php
    
    }
    add_action( 'give_after_donation_levels', 'give_myprefix_custom_form_fields', 10, 1 );
Viewing 1 replies (of 1 total)
  • The topic ‘Custom fields using My custom function leads to error’ is closed to new replies.