Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1359190
    Christopher
    Moderator

    Hi there,

    You shouldn’t edit x theme’s functions.php, please remove following code from this file :

    /**
     * Custom Form Fields
     * 
     * @param $form_id
     */
    function give_myprefix_custom_form_fields( $form_id ) {
    
    	//Only display for a specific form;
    	//Remove "If" statement to display on all forms
    	if ( $form_id == '452' ) {
    		?>
    		<div id="give-referral-wrap">
    			<label class="give-label" for="give-referral"><?php _e( 'What or Who are you giving towards? (For example: Tithe or John Doe)', 'give' ); ?></label>
    	}endif;
    }
    
    add_action( 'give_after_donation_levels', 'give_myprefix_custom_form_fields', 10, 1 );
    
    /**
     * Add Field to Payment Meta
     *
     * @description store the custom field data in the payment meta
     *
     * @param $payment_meta
     *
     * @return mixed
     */
    function give_myprefix_store_custom_fields( $payment_meta ) {
    	$payment_meta['referral'] = isset( $_POST['give_referral'] ) ? implode( "n", array_map( 'sanitize_text_field', explode( "n", $_POST['give_referral'] ) ) ) : '';
    
    	return $payment_meta;
    }
    

    All custom functions should be added in child theme’s functions.php file.

    Thanks.

    #1359736
    teddyholcomb
    Participant
    This reply has been marked as private.
    #1359756
    teddyholcomb
    Participant

    THANK YOU!!!! The site is back up & running!!!! Could you help explain to me a little better where I need to add any code like that so it won’t shut the site down? I’m only trying to add one custom field to my “Give” plugin form. I used code from their site that they referred to as a “Hook”. It’s my first time trying to add something like that within WP and a plugin.

    Thank you!

    #1359780
    Joao
    Moderator

    Hi There,

    You need to install a Child Theme, you can download your child theme from here:

    https://community.theme.co/dashboard/

    For more info refer to:

    https://community.theme.co/kb/how-to-setup-child-themes/

    Than you have to add the code above to the function.php of your Child Theme.

    Let us know if you have further questions,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1339774 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>