Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brettshumaker/fa30c964e4044350625412fa2e39b9c2 to your computer and use it in GitHub Desktop.
Save brettshumaker/fa30c964e4044350625412fa2e39b9c2 to your computer and use it in GitHub Desktop.
Filter to add variable price name to an EDD Software License remote license check
<?php
add_filter( 'edd_remote_license_check_response', 'bsgist_add_data_to_license_check', 10, 3 );
function bsgist_add_data_to_license_check( $json, $args, $license_id ) {
$price_id = get_post_meta( $license_id, '_edd_sl_download_price_id', true );
$download_id = edd_software_licensing()->get_download_id( $license_id );
$download_variable_prices = get_post_meta($download_id, 'edd_variable_prices', true);
$json['account_level'] = $download_variable_prices[$price_id]['name'];
return $json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment