Forked from strangerstudios/my_pmpro_invoice_address.php
Last active
October 18, 2019 08:43
-
-
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.
This file contains hidden or 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 // 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