Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/c3c12dd84d3b37d33e4cb0b09b9427aa to your computer and use it in GitHub Desktop.
Save dwanjuki/c3c12dd84d3b37d33e4cb0b09b9427aa to your computer and use it in GitHub Desktop.
Add a user field to the invoice page
<?php
/**
* This recipe adds a user field to the invoice page.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function add_user_fields_to_pmpro_invoice() {
global $current_user;
$field_value = get_user_meta( $current_user->ID, 'your_field_name', true );
echo '<li><strong>Your field:</strong> ' . $field_value . '</li>';
}
add_action( 'pmpro_invoice_bullets_bottom', 'add_user_fields_to_pmpro_invoice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment