Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/fd878ad25c95ee1b6f7a50e282216d03 to your computer and use it in GitHub Desktop.
Save dwanjuki/fd878ad25c95ee1b6f7a50e282216d03 to your computer and use it in GitHub Desktop.
Display Company Name as a bullet on the PMPro Invoice
<?php
/**
* Display Company Name as a bullet on the PMPro Invoice.
*
* 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 my_pmpro_custom_invoice_bullet_bottom( $invoice ) {
$user = get_userdata( $invoice->user_id );
// Company Name
if ( ! empty( $user->company_name ) ) {
echo '<li><strong>Company: </strong>' . esc_html( $user->company_name ) . '</li>';
}
}
add_action( 'pmpro_invoice_bullets_bottom', 'my_pmpro_custom_invoice_bullet_bottom' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment