Title: Custom Fields Data
Last modified: October 22, 2022

---

# Custom Fields Data

 *  Resolved [smdstudios](https://wordpress.org/support/users/smdstudios/)
 * (@smdstudios)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/)
 * Hi,
 * I’ve added 2 custom fields to my donation forms following the documentation using
   the mothers name example.
 * It appears to be functioning when submitting the info but I don’t see where the
   information is visible in the back end. Is there additional code that I need 
   to add to view it on the backend?
 * [https://givewp.com/documentation/developers/how-to-create-custom-form-fields/](https://givewp.com/documentation/developers/how-to-create-custom-form-fields/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15942840)
 * Hi [@smdstudios](https://wordpress.org/support/users/smdstudios/),
 * You can use this function to display the field data in the donation details page:
 *     ```
       function render_givewp_field_api_fields( $payment_id ) {
   
       	$field_name = give_get_meta( $payment_id, 'guestName', true );
   
       	if ( $field_name ) : ?>
   
       		<div id="<?php echo wpautop( $field_name ); ?>" class="postbox">
       			<!--Replace 'Field Label' with a relevant label. -->
       			<h3 class="handle"><?php esc_html_e( 'Field label', 'give' ); ?></h3>
       			<div class="inside" style="padding-bottom:10px;">
       				<?php echo wpautop( $field_name ); ?>
       			</div>
       		</div>
   
       	<?php endif;
   
       }
   
       add_action( 'give_view_donation_details_billing_after', 'render_givewp_field_api_fields', 10, 1 );
       ```
   
 * Hope it helps!
 *  Thread Starter [smdstudios](https://wordpress.org/support/users/smdstudios/)
 * (@smdstudios)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15943867)
 * Thank you.
 * Just to clarify I can drop the code into my functions file, edit and that is 
   all the code I need?
 * Your code didn’t do anything for me so I want to ensure I’m not missing something.
 * Same goes for the custom fields I added to my donations page?
 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15946547)
 * Hi, [@smdstudios](https://wordpress.org/support/users/smdstudios/).
 * Yes, that’s what you’d need to do. If you need assistance implementing custom
   PHP code on your website we have this guide:
 * [https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/](https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/)
 * Please note that this code snippet is provided as an example of how you can extend
   GiveWP with code. It’s up to you to implement and customize to your liking. We
   cannot provide support for custom code on your website, only the code that we
   create and distribute.
 * It’s important that you edit the code though to reflect the custom fields you
   created.
 * Thanks for using GiveWP! Have a great day.
 *  Thread Starter [smdstudios](https://wordpress.org/support/users/smdstudios/)
 * (@smdstudios)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15946744)
 * Thank you..I just wanted to make sure that I didn’t need to write any additional
   code actually to save it to the DB.
 * If I can’t get that display function to work, I can manually pull the custom 
   fields from the DB.
 *  [natecovington](https://wordpress.org/support/users/natecovington/)
 * (@natecovington)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15946882)
 * Try something like this:
 *     ```
       function render_givewp_field_api_fields( $payment_id ) {
   
       	$occupation = give_get_meta( $payment_id, 'occupation', true );
       	$employer = give_get_meta( $payment_id, 'occupation', true );
   
       	if ( $occupation ) : ?>
   
       		<div id="<?php echo wpautop( $occupation ); ?>" class="postbox">
       			<!--Replace 'Field Label' with a relevant label. -->
       			<h3 class="handle"><?php esc_html_e( 'Occupation', 'give' ); ?></h3>
       			<div class="inside" style="padding-bottom:10px;">
       				<?php echo wpautop( $occupation ); ?>
       			</div>
       		</div>
   
       	<?php endif;
   
       }
   
       if ( $employer ) : ?>
   
       		<div id="<?php echo wpautop( $employer ); ?>" class="postbox">
       			<!--Replace 'Field Label' with a relevant label. -->
       			<h3 class="handle"><?php esc_html_e( 'Employer', 'give' ); ?></h3>
       			<div class="inside" style="padding-bottom:10px;">
       				<?php echo wpautop( $employer ); ?>
       			</div>
       		</div>
   
       	<?php endif;
   
       }
   
       add_action( 'give_view_donation_details_billing_after', 'render_givewp_field_api_fields', 10, 1 );
       ```
   
    -  This reply was modified 3 years, 8 months ago by [natecovington](https://wordpress.org/support/users/natecovington/).
    -  This reply was modified 3 years, 8 months ago by [natecovington](https://wordpress.org/support/users/natecovington/).
 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15949779)
 * Hi, [@smdstudios](https://wordpress.org/support/users/smdstudios/).
 * Do you still need assistance here? Looking forward to helping you get to the 
   bottom of this!
 *  Thread Starter [smdstudios](https://wordpress.org/support/users/smdstudios/)
 * (@smdstudios)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15949942)
 * I still haven’t been able to get the data to appear in the admin section.
 * I might just skip that and try and just get the extra fields in a data export.
   Is there any additional code needed for that?
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15951388)
 * Hi [@smdstudios](https://wordpress.org/support/users/smdstudios/),
 * I made a quick and dirty video tutorial here that shows you how to add the custom
   field data to the donation details page and to the export: [https://somup.com/c3jT04Ujl9](https://somup.com/c3jT04Ujl9)
 * Here’s the code I used there:
    [https://gist.github.com/rickalday/ac01194ea0a930b5816f41754fa5a148](https://gist.github.com/rickalday/ac01194ea0a930b5816f41754fa5a148)
 * If you use the Code Snippets plugin as I did, you don’t need the opening `<?php`
   tag in the code.
 * Hope it helps!
 *  Thread Starter [smdstudios](https://wordpress.org/support/users/smdstudios/)
 * (@smdstudios)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15957596)
 * Thank you! That helped a lot!!
 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15966658)
 * Glad to hear that, [@smdstudios](https://wordpress.org/support/users/smdstudios/).
   [@mrdaro](https://wordpress.org/support/users/mrdaro/) is a gem!
 * We’re looking to earn more 5-star reviews on our WordPress.org page. If you’ve
   found our support helpful and if you’ve been loving the GiveWP plugin, I’d love
   to earn a 5-star review from you!
    ​ ​WordPress: [https://wordpress.org/support/view/plugin-reviews/give](https://wordpress.org/support/view/plugin-reviews/give)
 * Reviews help other organizations see how much value and success other GiveWP 
   users get from our products. I truly appreciate your time! (and you’d totally
   make my day 😊).
 * Thanks for using GiveWP! Have a great day.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Custom Fields Data’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * 10 replies
 * 6 participants
 * Last reply from: [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/custom-fields-data-2/#post-15966658)
 * Status: resolved