Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ipokkel/c765ba670e33ccbac435dd38b85378ef to your computer and use it in GitHub Desktop.

Select an option

Save ipokkel/c765ba670e33ccbac435dd38b85378ef to your computer and use it in GitHub Desktop.
Add and translate your business address and VAT number to the Membership Invoice and Membership Confirmation pages.
<?php // Do NOT copy this line
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_action( 'pmpro_invoice_bullets_bottom', 'my_pmpro_invoice_address' );
function my_pmpro_invoice_address() {
?>
<li><strong><?php _e( 'Paid To', 'pmpro-customizations' ); ?>:</strong><br />My Business<br />123 The Street<br />City, XX 12345 USA</li>
<li><strong><?php _e( 'VAT Number', 'pmpro-customizations' ); ?>:</strong> BG999999999</li>
<?php
}
add_filter( 'gettext', 'change_text_for_pmpro_customizations', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_text_for_pmpro_customizations( $translated_text, $text, $domain ) {
// Example German translation strings obtained from Deepl.com
switch ( $translated_text ) {
case 'Paid To':
$translated_text = __( 'Bezahlt an', 'pmpro-customizations' );
break;
case 'VAT Number':
$translated_text = __( 'Umsatzsteuer-Identifikationsnummer', 'pmpro-customizations' );
break;
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment