Created
April 10, 2013 12:58
-
-
Save kloon/5354377 to your computer and use it in GitHub Desktop.
WooCommerce Software Licences on My Account page
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 | |
| add_action( 'woocommerce_before_my_account', 'woocommerce_customer_licenses_my_account' ); | |
| function woocommerce_customer_licenses_my_account() { | |
| global $wpdb; | |
| $current_user = wp_get_current_user(); | |
| $licence_keys = $wpdb->get_results( | |
| $wpdb->prepare( | |
| " | |
| SELECT * FROM {$wpdb->prefix}woocommerce_software_licences | |
| WHERE activation_email = %s | |
| ", | |
| $current_user->user_email | |
| ) | |
| ); | |
| echo "<h2>Software Licenses</h2>"; | |
| foreach ( $licence_keys as $license_key ) { | |
| echo $license_key->licence_key; | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment