Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created December 30, 2016 04:44
Show Gist options
  • Select an option

  • Save SeanChDavis/c789f51a1b84557e3b679526009755fc to your computer and use it in GitHub Desktop.

Select an option

Save SeanChDavis/c789f51a1b84557e3b679526009755fc to your computer and use it in GitHub Desktop.
EDD SL Purchase History Overwrite
<?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