Forked from andrewlimaza/woocommerce_billing_fields_pmpro_invoice.php
Last active
November 1, 2024 14:19
-
-
Save dwanjuki/c3c12dd84d3b37d33e4cb0b09b9427aa to your computer and use it in GitHub Desktop.
Add user fields to the invoice page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe adds user fields 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_a = get_user_meta( $current_user->ID, 'your_field_name', true ); | |
$field_b = get_user_meta( $current_user->ID, 'another_field_name', true ); | |
echo '<li><strong>Field A Label :</strong> ' . $field_a . '</li>'; | |
echo '<li><strong>Field B Label :</strong> ' . $field_b . '</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