本文整理汇总了PHP中edd_software_licensing函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_software_licensing函数的具体用法?PHP edd_software_licensing怎么用?PHP edd_software_licensing使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edd_software_licensing函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wc_edd_email_purchase_receipt
/**
* Helper Functions
*/
function wc_edd_email_purchase_receipt($payment_id, $download_id)
{
$payment_data = edd_get_payment_meta($payment_id);
$download = get_post($download_id);
$license = edd_software_licensing()->get_license_by_purchase($payment_id, $download_id);
$from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
$from_name = apply_filters('edd_purchase_from_name', $from_name, $payment_id, $payment_data);
$from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
$from_email = apply_filters('edd_purchase_from_address', $from_email, $payment_id, $payment_data);
$to_email = edd_get_payment_user_email($payment_id);
$subject = edd_get_option('purchase_subject', __('New License Key', 'edd'));
$subject = apply_filters('edd_purchase_subject', wp_strip_all_tags($subject), $payment_id);
$subject = edd_do_email_tags($subject, $payment_id);
$message = "Dear " . edd_email_tag_first_name($payment_id) . ",\n\n";
$message .= "As you have updated " . $download->post_title . ", please use following new license key to continue getting future updates: \n\n";
$message .= "License Key : " . edd_software_licensing()->get_license_key($license->ID) . "\n\n";
$message .= "Sorry for inconvenience.";
$emails = EDD()->emails;
$emails->__set('from_name', $from_name);
$emails->__set('from_email', $from_email);
$emails->__set('heading', __('Purchase Receipt', 'edd'));
$headers = apply_filters('edd_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
$emails->__set('headers', $headers);
$emails->send($to_email, $subject, $message, array());
if ($admin_notice && !edd_admin_notices_disabled($payment_id)) {
do_action('edd_admin_sale_notice', $payment_id, $payment_data);
}
}
示例2: edd_sl_current_user_has_valid_license_for
/**
* Check if the current user has a valid license for the $download_id passed-in.
*
* @param array ( 'download' => Download/Item ID (post_id), 'price_id' => Price ID )
* @return bool true/false
*/
function edd_sl_current_user_has_valid_license_for($download_ids)
{
// Get the current user ID
$current_user_id = get_current_user_id();
// Set default for license validity to false
$license_valid_for_download = false;
// Get the current user's purchases
$user_purchases = edd_get_users_purchases($current_user_id);
if ($user_purchases) {
foreach ($user_purchases as $user_purchase) {
setup_postdata($user_purchase);
// Get all the licenses for all the user's purchases
$sl = edd_software_licensing();
$licenses = $sl->get_licenses_of_purchase($user_purchase->ID);
if (is_array($licenses)) {
foreach ($licenses as $license_post) {
$license_key = get_post_meta($license_post->ID, '_edd_sl_key', true);
foreach ($download_ids as $download_id) {
if ($sl->is_download_id_valid_for_license($download_id['download'], $license_key)) {
$license_status = $sl->get_license_status($license_post->ID);
if ($license_status != 'expired' && $license_post->post_status == 'publish') {
$license_valid_for_download = true;
break;
}
}
}
}
}
wp_reset_postdata();
}
}
return $license_valid_for_download;
}
示例3: deactivate_site_license
/**
* Deactivates the given site
*/
function deactivate_site_license()
{
authorize_request();
$license_id = sanitize_text_field($_GET['license_id']);
$site_url = sanitize_text_field($_GET['site_url']);
edd_software_licensing()->delete_site($license_id, $site_url);
die('<script>window.close();</script>');
}
示例4: edd_sl_hide_downloads_on_expired
/**
* Hide download links for expired licenses on purchase receipt page
*
* @access private
* @since 2.3
* @return void
*/
function edd_sl_hide_downloads_on_expired($show, $item, $receipt_args)
{
$payment_id = $receipt_args['id'];
$licenses = edd_software_licensing()->get_licenses_of_purchase($payment_id);
if (!empty($licenses)) {
foreach ($licenses as $license) {
if ('expired' == edd_software_licensing()->get_license_status($license->ID)) {
$show = false;
break;
}
}
}
return $show;
}
示例5: check_for_request
public function check_for_request()
{
if (empty($_POST['rcp_action']) || 'get_version' != $_POST['rcp_action']) {
return;
}
if (empty($_POST['license'])) {
return;
}
if (empty($_POST['id']) || !is_numeric($_POST['id'])) {
return;
}
if (empty($_POST['slug'])) {
return;
}
if (empty($_POST['url'])) {
return;
}
if (!function_exists('edd_software_licensing')) {
return;
}
$add_on = get_post(absint($_POST['id']));
if (!$add_on) {
status_header(404);
return;
}
$licensing = edd_software_licensing();
$license = $licensing->get_license_by_key(sanitize_text_field($_POST['license']));
if (!$license) {
status_header(402);
return;
}
$price_id = (int) get_post_meta($license, '_edd_sl_download_price_id', true);
if (3 !== $price_id && 4 !== $price_id) {
status_header(401);
return;
// Not a developer license
}
// All good, retrieve the Add On details
if ('expired' === $licensing->get_license_status($license)) {
$description = '<p><strong>' . __('Your license is expired. Please renew it or purchase a new one in order to update this item.', 'edd_sl') . '</strong></p>' . $description;
$changelog = '<p><strong>' . __('Your license is expired. Please renew it or purchase a new one in order to update this item.', 'edd_sl') . '</strong></p>' . $changelog;
} else {
$changelog = get_post_meta($add_on->ID, '_edd_sl_changelog', true);
$description = !empty($add_on->post_excerpt) ? $add_on->post_excerpt : $add_on->post_content;
}
$response = array('new_version' => get_post_meta($add_on->ID, '_edd_sl_version', true), 'name' => $add_on->post_title, 'slug' => $_POST['slug'], 'url' => get_permalink($add_on->ID), 'homepage' => get_permalink($add_on->ID), 'package' => $this->get_encoded_download_package_url($add_on->ID, $_POST['license'], $_POST['url']), 'download_link' => $this->get_encoded_download_package_url($add_on->ID, $_POST['license'], $_POST['url']), 'sections' => serialize(array('description' => wpautop(strip_tags($description, '<p><li><ul><ol><strong><a><em><span><br>')), 'changelog' => wpautop(strip_tags(stripslashes($changelog), '<p><li><ul><ol><strong><a><em><span><br>')))));
echo json_encode($response);
exit;
}
示例6: edd_sl_site_management_links
/**
* Displays a Manage Licenses link in purchase history
*
* @since 2.7
*/
function edd_sl_site_management_links($payment_id, $purchase_data)
{
$licensing = edd_software_licensing();
$downloads = edd_get_payment_meta_downloads($payment_id);
if ($downloads) {
$manage_licenses_url = esc_url(add_query_arg(array('action' => 'manage_licenses', 'payment_id' => $payment_id)));
echo '<td class="edd_license_key">';
if (edd_is_payment_complete($payment_id)) {
echo '<a href="' . esc_url($manage_licenses_url) . '">' . __('View Licenses', 'edd_sl') . '</a>';
} else {
echo '-';
}
echo '</td>';
}
}
示例7: populate_choices
public function populate_choices($choices)
{
$licenses = edd_software_licensing()->get_license_keys_of_user(get_current_user_id());
if (empty($licenses)) {
return $choices;
}
$to_add = array();
foreach ($licenses as $license) {
$key = edd_software_licensing()->get_license_key($license->ID);
$download = get_post(edd_software_licensing()->get_download_by_license($key));
$status = edd_software_licensing()->get_license_status($license->ID);
if (0 === $download->ID || 'expired' == $status) {
continue;
}
$choices[] = array('value' => 'valid-' . sanitize_title(get_the_title($download->ID)), 'text' => get_the_title($download->ID) . ' — Expires: ' . date_i18n(get_option('date_format'), strtotime(edd_software_licensing()->get_license_expiration($license->ID))));
}
return $choices;
}
示例8: process_renew_all
public function process_renew_all()
{
if (empty($_POST['edd_renew_all'])) {
return;
}
if (!is_user_logged_in()) {
return;
}
if (!wp_verify_nonce($_POST['edd_sl_renew_all'], 'edd_sl_renew_all_nonce')) {
wp_die(__('Error', 'edd-sl-renew-all'), __('Nonce verification failed', 'edd-sl-renew-all'), array('response' => 403));
}
$renew_type = edd_sanitize_text_field($_POST['edd_sl_renew_type']);
$license_keys = edd_software_licensing()->get_license_keys_of_user(get_current_user_id());
switch ($renew_type) {
case 'expired':
$stop_date = current_time('timestamp');
break;
case 'expiring_1_month':
$stop_date = strtotime('+1 month', current_time('timestamp'));
break;
case 'all':
default:
$stop_date = false;
break;
}
if ($license_keys) {
foreach ($license_keys as $license) {
if (!edd_software_licensing()->get_license_key($license->ID)) {
continue;
}
$expiration = edd_software_licensing()->get_license_expiration($license->ID);
if ('lifetime' === $expiration) {
continue;
}
if ($stop_date && $expiration > $stop_date) {
continue;
}
edd_sl_add_renewal_to_cart($license->ID);
}
wp_redirect(edd_get_checkout_uri());
exit;
}
}
示例9: record_subscription_payment
/**
* Record a subscription payment
*
* @since 1.0.1
* @return void
*/
public function record_subscription_payment($parent_id = 0, $amount = '', $txn_id = '', $unique_key = 0)
{
global $edd_options;
if ($this->payment_exists($unique_key)) {
return;
}
// increase the earnings for each product in the subscription
$downloads = edd_get_payment_meta_downloads($parent_id);
if ($downloads) {
foreach ($downloads as $download) {
edd_increase_earnings($download['id'], $amount);
}
}
// setup the payment daya
$payment_data = array('parent' => $parent_id, 'price' => $amount, 'user_email' => edd_get_payment_user_email($parent_id), 'purchase_key' => get_post_meta($parent_id, '_edd_payment_purchase_key', true), 'currency' => edd_get_option('currency', 'usd'), 'downloads' => $downloads, 'user_info' => edd_get_payment_meta_user_info($parent_id), 'cart_details' => edd_get_payment_meta_cart_details($parent_id), 'status' => 'edd_subscription', 'gateway' => edd_get_payment_gateway($parent_id));
// record the subscription payment
$payment = edd_insert_payment($payment_data);
if (!empty($unique_key)) {
update_post_meta($payment, '_edd_recurring_' . $unique_key, '1');
}
// Record transaction ID
if (!empty($txn_id)) {
if (function_exists('edd_set_payment_transaction_id')) {
edd_set_payment_transaction_id($payment, $txn_id);
}
}
// Update the expiration date of license keys, if EDD Software Licensing is active
if (function_exists('edd_software_licensing')) {
$licenses = edd_software_licensing()->get_licenses_of_purchase($parent_id);
if (!empty($licenses)) {
foreach ($licenses as $license) {
// Update the expiration dates of the license key
edd_software_licensing()->renew_license($license->ID, $parent_id);
}
}
}
do_action('edd_recurring_record_payment', $payment, $parent_id, $amount, $txn_id, $unique_key);
}
示例10: licenses_data
/**
* Query database for license data and prepare it for the table
*
* @access private
* @since 1.0
* @return array
*/
function licenses_data()
{
$licenses_data = array();
$license_args = array('post_type' => 'edd_license', 'post_status' => array('publish', 'future', 'draft'), 'posts_per_page' => $this->per_page, 'paged' => $this->get_paged(), 'meta_query' => array('relation' => 'AND'), 'post_parent' => 0);
$view = isset($_GET['view']) ? $_GET['view'] : false;
if ($view && 'disabled' == $view) {
$license_args['post_status'] = 'draft';
} elseif ($view) {
$license_args['meta_query'][] = array('key' => '_edd_sl_status', 'value' => $view);
}
$key_search = false;
// check to see if we are searching
if (!empty($_GET['s'])) {
$search = trim($_GET['s']);
if (!is_email($search)) {
$has_period = strstr($search, '.');
if (false === $has_period && !preg_match('/\\s/', $search)) {
// Search in the license key.
$license_args['meta_query'][] = array('key' => '_edd_sl_key', 'value' => $search);
$key_search = true;
unset($license_args['post_parent']);
} elseif ($has_period) {
// Search in the sites that are registered.
$license_args['meta_query'][] = array('key' => '_edd_sl_sites', 'value' => edd_software_licensing()->clean_site_url($search), 'compare' => 'LIKE');
} else {
$license_args['s'] = $search;
}
} else {
$license_args['s'] = $search;
}
}
$orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'ID';
$order = isset($_GET['order']) ? $_GET['order'] : 'DESC';
$order_inverse = $order == 'DESC' ? 'ASC' : 'DESC';
$license_args['order'] = $order;
switch ($orderby) {
case 'purchased':
$license_args['orderby'] = 'date';
break;
case 'expires':
$license_args['orderby'] = 'meta_value_num';
$license_args['meta_key'] = '_edd_sl_expiration';
break;
}
$licenses = get_posts($license_args);
// If searching by Key
if ($key_search) {
$found_license = $licenses[0];
// And we found a child license
if (!empty($found_license->post_parent)) {
// Swap out the meta query for the parent license to show the entire bundle
$parent_license_key = get_post_meta($found_license->post_parent, '_edd_sl_key', true);
foreach ($license_args['meta_query'] as $key => $args) {
if (!empty($args['key']) && '_edd_sl_key' === $args['key']) {
$license_args['meta_query'][$key]['value'] = $parent_license_key;
}
}
$licenses = get_posts($license_args);
}
}
if ($licenses) {
foreach ($licenses as $license) {
$status = get_post_meta($license->ID, '_edd_sl_status', true);
$key = get_post_meta($license->ID, '_edd_sl_key', true);
$user = get_post_meta($license->ID, '_edd_sl_user_id', true);
$expires = date_i18n(get_option('date_format'), (int) get_post_meta($license->ID, '_edd_sl_expiration', true));
$purchased = get_the_time(get_option('date_format'), $license->ID);
$download_id = get_post_meta($license->ID, '_edd_sl_download_id', true);
$licenses_data[] = array('ID' => $license->ID, 'title' => get_the_title($license->ID), 'status' => $status, 'key' => $key, 'user' => $user, 'expires' => $expires, 'purchased' => $purchased, 'download_id' => $download_id, 'is_child_license' => false);
if (edd_is_bundled_product($download_id)) {
$child_args = array('post_type' => 'edd_license', 'post_status' => array('publish', 'future'), 'posts_per_page' => -1, 'post_parent' => $license->ID);
$child_licenses = get_children($child_args);
} else {
$child_licenses = false;
}
if (!empty($child_licenses)) {
foreach ($child_licenses as $child_license) {
$child_license_status = get_post_meta($child_license->ID, '_edd_sl_status', true);
if (!empty($_GET['view']) && $child_license_status !== $_GET['view']) {
continue;
}
$licenses_data[] = array('ID' => $child_license->ID, 'title' => get_the_title($child_license->ID), 'status' => $status, 'key' => $key, 'user' => $user, 'expires' => $expires, 'purchased' => $purchased, 'download_id' => get_post_meta($child_license->ID, '_edd_sl_download_id', true), 'is_child_license' => true);
}
}
}
}
return $licenses_data;
}
示例11: edd_sl_process_license_upgrade
/**
* Process the license upgrade during purchase
*
* @since 3.3
* @return void
*/
function edd_sl_process_license_upgrade($download_id = 0, $payment_id = 0, $type = 'default', $cart_item = array(), $cart_index = 0)
{
// Bail if this is not a renewal item
if (empty($cart_item['item_number']['options']['is_upgrade'])) {
return;
}
$license_id = $cart_item['item_number']['options']['license_id'];
$upgrade_id = $cart_item['item_number']['options']['upgrade_id'];
$upgrade = edd_sl_get_upgrade_path($download_id, $upgrade_id);
$old_payment_ids = get_post_meta($license_id, '_edd_sl_payment_id');
$old_payment_id = end($old_payment_ids);
// We only want the most recent one
$old_download_id = edd_software_licensing()->get_download_id($license_id);
$old_price_id = edd_software_licensing()->get_price_id($license_id);
$purchase_date = get_post_field('post_date', $old_payment_id);
if (edd_is_bundled_product($download_id)) {
// Upgrade to a bundle from a standard license
$downloads = array();
$bundle_licensing = (bool) get_post_meta($download_id, '_edd_sl_enabled', true);
$parent_license_id = 0;
$activation_limit = false;
$user_info = edd_get_payment_meta_user_info($payment_id);
if ($bundle_licensing) {
$downloads[] = $download_id;
}
$downloads = array_merge($downloads, edd_get_bundled_products($download_id));
if (edd_has_variable_prices($download_id)) {
$activation_limit = edd_software_licensing()->get_price_activation_limit($download_id, $cart_item['item_number']['options']['price_id']);
$is_lifetime = edd_software_licensing()->get_price_is_lifetime($download_id, $cart_item['item_number']['options']['price_id']);
}
foreach ($downloads as $d_id) {
if ((int) $d_id === (int) $old_download_id) {
continue;
}
if (!get_post_meta($d_id, '_edd_sl_enabled', true)) {
continue;
}
$license_title = get_the_title($d_id) . ' - ' . $user_info['email'];
$license_args = array('post_type' => 'edd_license', 'post_title' => $license_title, 'post_status' => 'publish', 'post_date' => get_post_field('post_date', $payment_id, 'raw'));
if ($parent_license_id) {
$license_args['post_parent'] = $parent_license_id;
}
$l_id = wp_insert_post(apply_filters('edd_sl_insert_license_args', $license_args));
if ($bundle_licensing && $download_id == $d_id && !$parent_license_id) {
$parent_license_id = $l_id;
}
$license_key = edd_software_licensing()->get_new_download_license_key($d_id);
if (!$license_key) {
// No predefined license key available, generate a random one
$license_key = edd_software_licensing()->generate_license_key($l_id, $d_id, $payment_id, $cart_index);
}
$price_id = isset($cart_item['item_number']['options']['price_id']) ? (int) $cart_item['item_number']['options']['price_id'] : false;
add_post_meta($l_id, '_edd_sl_download_id', $d_id);
if (false !== $price_id) {
add_post_meta($l_id, '_edd_sl_download_price_id', $price_id);
}
add_post_meta($l_id, '_edd_sl_cart_index', $cart_index);
add_post_meta($l_id, '_edd_sl_payment_id', $payment_id);
add_post_meta($l_id, '_edd_sl_key', $license_key);
add_post_meta($l_id, '_edd_sl_user_id', $user_info['id']);
add_post_meta($l_id, '_edd_sl_status', 'inactive');
add_post_meta($l_id, '_edd_sl_site_count', 0);
if ($parent_license_id && !empty($activation_limit)) {
add_post_meta($l_id, '_edd_sl_limit', $activation_limit);
}
// Get license length
$license_length = edd_software_licensing()->get_license_length($l_id, $payment_id, $d_id);
if (empty($is_lifetime) && 'lifetime' !== $license_length) {
// Set license expiration date
delete_post_meta($l_id, '_edd_sl_is_lifetime');
edd_software_licensing()->set_license_expiration($l_id, strtotime($license_length, strtotime($purchase_date)));
} else {
edd_software_licensing()->set_license_as_lifetime($l_id);
}
do_action('edd_sl_store_license', $l_id, $d_id, $payment_id, $type);
}
// Now update the original license
wp_update_post(array('ID' => $license_id, 'post_parent' => $parent_license_id));
update_post_meta($license_id, '_edd_sl_cart_index', $cart_index);
add_post_meta($license_id, '_edd_sl_payment_id', $payment_id);
} else {
// Standard license upgrade
$new_title = get_the_title($download_id) . ' - ' . edd_get_payment_user_email($payment_id);
wp_update_post(array('ID' => $license_id, 'post_title' => $new_title));
update_post_meta($license_id, '_edd_sl_cart_index', $cart_index);
add_post_meta($license_id, '_edd_sl_payment_id', $payment_id);
update_post_meta($license_id, '_edd_sl_download_id', $download_id);
if (edd_has_variable_prices($download_id)) {
$limit = edd_software_licensing()->get_price_activation_limit($download_id, $upgrade['price_id']);
$is_lifetime = edd_software_licensing()->get_price_is_lifetime($download_id, $upgrade['price_id']);
update_post_meta($license_id, '_edd_sl_download_price_id', $upgrade['price_id']);
} else {
$limit = edd_software_licensing()->get_license_limit($download_id, $license_id);
}
//.........这里部分代码省略.........
示例12: edd_pup_get_license_keys
/**
* Return array of license keys matched with download ID for payment/customer
*
* @access public
* @param mixed $payment_id
*
* @return array $key
*/
function edd_pup_get_license_keys($payment_id)
{
$keys = '';
$licenses = edd_software_licensing()->get_licenses_of_purchase($payment_id);
if ($licenses) {
foreach ($licenses as $license) {
$meta = get_post_custom($license->ID);
$keys[$meta['_edd_sl_download_id'][0]] = array('license_id' => $license->ID, 'key' => $meta['_edd_sl_key'][0]);
}
}
return $keys;
}
示例13: _e
<td colspan="2"><?php
_e('No sites have been activated for this license', 'edd_sl');
?>
</td>
<?php
do_action('edd_sl_license_sites_row_end', $license_id);
?>
</tr>
<?php
}
?>
</table>
<?php
$status = edd_software_licensing()->get_license_status($license_id);
$at_limit = edd_software_licensing()->is_at_limit($license_id, $download_id);
?>
<?php
if (!$at_limit && ($status == 'active' || $status == 'inactive')) {
?>
<form method="post" id="edd_sl_license_add_site_form" class="edd_sl_form">
<div>
<span><?php
_e('Use this form to authorize a new site URL for this license. Enter the full site URL.', 'edd_sl');
?>
</span>
<input type="text" name="site_url" class="edd-input" value="http://"/>
<input type="submit" class="button-primary button" value="<?php
_e('Add Site', 'edd_sl');
?>
示例14: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget($args, $instance)
{
//No EDD? Bail
if (!class_exists('Easy_Digital_Downloads')) {
return false;
}
//Not EDD admin? Bail
if (!current_user_can('view_shop_sensitive_data')) {
return false;
}
//Handle before_widget args
echo $args['before_widget'];
if (!empty($instance['title'])) {
echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
}
$user_id = get_the_author_meta('ID');
$user_data = get_userdata($user_id);
?>
<div class="box">
<?php
do_action('wi_bbp_sidebar');
?>
<h3><?php
echo get_the_author_meta('first_name') . ' ' . get_the_author_meta('last_name');
?>
</h3>
<p class="bbp-user-forum-role"><?php
printf('Forum Role: %s', bbp_get_user_display_role($user_id));
?>
</p>
<p class="bbp-user-topic-count"><?php
printf('Topics Started: %s', bbp_get_user_topic_count_raw($user_id));
?>
</p>
<p class="bbp-user-reply-count"><?php
printf('Replies Created: %s', bbp_get_user_reply_count_raw($user_id));
?>
</p>
<div class="wi_users_purchases">
<h3><?php
_e('User\'s Purchases:', 'wi_bbp');
?>
</h3>
<?php
$purchases = edd_get_users_purchases($user_data->user_email, 100, false, 'any');
if ($purchases) {
echo '<ul>';
foreach ($purchases as $purchase) {
echo '<li>';
echo '<strong><a href="' . admin_url('edit.php?post_type=download&page=give-payment-history&view=view-order-details&id=' . $purchase->ID) . '">#' . $purchase->ID . ' - ' . edd_get_payment_status($purchase, true) . '</a></strong><br/>';
$downloads = edd_get_payment_meta_downloads($purchase->ID);
foreach ($downloads as $download) {
echo get_the_title($download['id']) . ' - ' . date('F j, Y', strtotime($purchase->post_date)) . '<br/>';
}
//Check license key
if (function_exists('edd_software_licensing')) {
$licenses = edd_software_licensing()->get_licenses_of_purchase($purchase->ID);
if ($licenses) {
echo '<strong>' . __('Licenses:', 'edd') . '</strong><br/>';
foreach ($licenses as $license) {
$key = edd_software_licensing()->get_license_key($license->ID);
$download_id = edd_software_licensing()->get_download_by_license($key);
$title = get_the_title($download_id);
//output license URL
echo $title . ' - <a href="' . admin_url('edit.php?post_type=download&page=give-licenses&s=' . $key) . '">' . $key . '</a>';
echo ' - ' . edd_software_licensing()->get_license_status($license->ID);
echo '<br/>';
}
}
echo '<hr/>';
}
echo '</li>';
}
echo '</ul>';
} else {
echo '<p>' . __('This user has never purchased anything.', 'wi_bbp') . '</p>';
}
?>
</div>
</div>
<?php
//After widget args
echo $args['after_widget'];
return false;
}
示例15: edd_software_licensing
echo edd_software_licensing()->get_site_count($license->ID);
?>
</span><span class="edd_sl_limit_sep"> / </span><span class="edd_sl_limit_max"><?php
echo edd_software_licensing()->license_limit($license->ID);
?>
</span></td>
<td><?php
if (3 === (int) $price_id) {
echo 'never';
} else {
echo date_i18n('F j, Y', edd_software_licensing()->get_license_expiration($license->ID));
}
?>
</td>
<?php
if (!edd_software_licensing()->force_increase()) {
?>
<td><a href="<?php
echo esc_url(add_query_arg('license_id', $license->ID));
?>
"><?php
_e('Manage Sites', 'edd_sl');
?>
</a></td>
<?php
}
?>
<?php
do_action('edd_sl_license_row_end', $license->ID);
?>
</tr>