Created
December 30, 2016 04:44
-
-
Save SeanChDavis/c789f51a1b84557e3b679526009755fc to your computer and use it in GitHub Desktop.
EDD SL Purchase History Overwrite
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 | |
| function custom_edd_sl_override_history_content( $content ) { | |
| if( empty( $_GET['action'] ) || 'manage_licenses' != $_GET['action'] ) { | |
| return $content; | |
| } | |
| if( empty( $_GET['payment_id'] ) ) { | |
| return $content; | |
| } | |
| if( ! in_the_loop() ) { | |
| return $content; | |
| } | |
| if( isset( $_GET['license_id'] ) && isset( $_GET['view'] ) && 'upgrades' == $_GET['view'] ) { | |
| ob_start(); | |
| edd_get_template_part( 'licenses', 'upgrades' ); | |
| $content = ob_get_clean(); | |
| } else { | |
| $view = isset( $_GET['license_id'] ) ? 'single' : 'overview'; | |
| ob_start(); | |
| edd_get_template_part( 'licenses', 'manage-' . $view ); | |
| $content = ob_get_clean(); | |
| } | |
| return $content; | |
| } | |
| remove_filter( 'the_content', 'edd_sl_override_history_content', 9999 ); | |
| add_filter( 'the_content', 'custom_edd_sl_override_history_content', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment