Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Add Copy to clipboard suport to discount codes, order ids, payment ids and more. #3217

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6723b5d
Make next payment date translatable
andrewlimaza Nov 12, 2024
49bfc6a
Rework is_numeric. It's not needed
andrewlimaza Nov 12, 2024
1280918
Update class-pmpro-subscription.php
andrewlimaza Nov 12, 2024
9b35148
Merge branch 'dev' into next-payment-date-i18n
andrewlimaza Nov 25, 2024
cee0626
Fixes to use wp_date instead
andrewlimaza Nov 25, 2024
3956e82
[BUGFIX] * Copy discount link should copy the code to the clipboard i…
MaximilianoRicoTabo Nov 28, 2024
9b3d31a
* Rename copy link to duplicate
MaximilianoRicoTabo Dec 16, 2024
a245498
Simplification
dparker1005 Dec 17, 2024
4fbc860
* If Clipboard API isn't supported remove all copy to clipboard butto…
MaximilianoRicoTabo Dec 18, 2024
a615678
Removing references to PayPal from the Membership Billing page
kimcoleman Jan 10, 2025
3717cbb
Adding custom ranges to the sales and revenue report
dparker1005 Jan 15, 2025
a30da96
Allow filtering the sales report by multiple levels/discount codes
dparker1005 Jan 15, 2025
0308999
Merge pull request #3195 from andrewlimaza/next-payment-date-i18n
dparker1005 Jan 21, 2025
91c2dc1
Merge pull request #3252 from kimcoleman/remove-paypal-refs-from-bill…
dparker1005 Jan 21, 2025
4fb4108
Merge branch 'dev' of https://github.com/strangerstudios/paid-members…
dparker1005 Jan 21, 2025
92ddda1
Improving the appearance and patching other reports for CSS structura…
kimcoleman Jan 21, 2025
2a0b9f0
Merge pull request #3258 from dparker1005/sales-report-multiple-level…
kimcoleman Jan 21, 2025
6d1372a
Merge remote-tracking branch 'upstream/v3.4' into sales-report-custom…
kimcoleman Jan 21, 2025
70ade9a
Merge pull request #3257 from dparker1005/sales-report-custom-range
kimcoleman Jan 21, 2025
0f78a3b
Merge remote-tracking branch 'upstream/v3.4' into bugfix/copy-discoun…
kimcoleman Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions adminpages/reports/logins.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function pmpro_report_login_page()
<div class="pmpro_report-filters">
<h3><?php esc_html_e( 'Customize Report', 'paid-memberships-pro'); ?></h3>
<div class="tablenav top">
<label for="l"><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show All Users', 'paid-memberships-pro' ); ?></label>
<label for="l" class="pmpro_report-filter-text"><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show All Users', 'paid-memberships-pro' ); ?></label>
<select id="l" name="l" onchange="jQuery('#visits-views-logins-form').trigger('submit');" aria-label="<?php esc_attr_e( 'Select a membership level to customize this report', 'paid-memberships-pro' ); ?>">
<option value="" <?php if(!$l) { ?>selected="selected"<?php } ?>><?php esc_html_e('All Users', 'paid-memberships-pro')?></option>
<option value="all" <?php if($l == "all") { ?>selected="selected"<?php } ?>><?php esc_html_e('All Levels', 'paid-memberships-pro')?></option>
Expand All @@ -185,7 +185,6 @@ function pmpro_report_login_page()
}
?>
</select>
<br class="clear" />
</div> <!-- end tablenav -->
</div> <!-- end pmpro_report-filters -->
<?php if ( $theusers ) { ?>
Expand Down
13 changes: 6 additions & 7 deletions adminpages/reports/memberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function pmpro_report_memberships_page() {
<div class="pmpro_report-filters">
<h3><?php esc_html_e( 'Customize Report', 'paid-memberships-pro' ); ?></h3>
<div class="tablenav top">
<span><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show Period', 'paid-memberships-pro' ); ?></span>
<span class="pmpro_report-filter-text"><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show Period', 'paid-memberships-pro' ); ?></span>
<label for="period" class="screen-reader-text"><?php esc_html_e( 'Select report time period', 'paid-memberships-pro' ); ?></label>
<select id="period" name="period">
<option value="daily" <?php selected( $period, 'daily' ); ?>><?php esc_html_e( 'Daily', 'paid-memberships-pro' ); ?></option>
Expand All @@ -357,7 +357,7 @@ function pmpro_report_memberships_page() {
<option value="signup_v_cancel" <?php selected( $type, 'signup_v_cancel' ); ?>><?php esc_html_e( 'Signups vs. Cancellations', 'paid-memberships-pro' ); ?></option>
<option value="signup_v_expiration" <?php selected( $type, 'signup_v_expiration' ); ?>><?php esc_html_e( 'Signups vs. Expirations', 'paid-memberships-pro' ); ?></option>
</select>
<span id="for"><?php esc_html_e( 'for', 'paid-memberships-pro' ); ?></span>
<span id="for" class="pmpro_report-filter-text"><?php esc_html_e( 'for', 'paid-memberships-pro' ); ?></span>
<label for="month" class="screen-reader-text"><?php esc_html_e( 'Select report month', 'paid-memberships-pro' ); ?></label>
<select id="month" name="month">
<?php for ( $i = 1; $i < 13; $i++ ) { ?>
Expand All @@ -370,7 +370,7 @@ function pmpro_report_memberships_page() {
<option value="<?php echo esc_attr( $i ); ?>" <?php selected( $year, $i ); ?>><?php echo esc_html( $i ); ?></option>
<?php } ?>
</select>
<span id="for"><?php esc_html_e( 'for', 'paid-memberships-pro' ); ?></span>
<span id="for" class="pmpro_report-filter-text"><?php esc_html_e( 'for', 'paid-memberships-pro' ); ?></span>
<label for="level" class="screen-reader-text"><?php esc_html_e( 'Filter report by membership level', 'paid-memberships-pro' ); ?></label>
<select id="level" name="level">
<option value=""
Expand Down Expand Up @@ -422,11 +422,10 @@ function pmpro_report_memberships_page() {
<?php } ?>
</select>
<?php } ?>
<input type="hidden" name="page" value="pmpro-reports" />
<input type="hidden" name="report" value="memberships" />
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Generate Report', 'paid-memberships-pro' ); ?>" />
<br class="clear" />
</div> <!-- end tablenav -->
<input type="hidden" name="page" value="pmpro-reports" />
<input type="hidden" name="report" value="memberships" />
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Generate Report', 'paid-memberships-pro' ); ?>" />
</div> <!-- end pmpro_report-filters -->
<div class="pmpro_chart_area">
<div id="chart_div" style="clear: both; width: 100%; height: 500px;"></div>
Expand Down
105 changes: 80 additions & 25 deletions adminpages/reports/sales.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ function pmpro_report_sales_data( $args ){

$type_function = ! empty( $args['type_function'] ) ? $args['type_function'] : '';
$report_unit = ! empty( $args['report_unit'] ) ? $args['report_unit'] : '';
$discount_code = ! empty( $args['discount_code'] ) ? $args['discount_code'] : '';
$discount_code = ! empty( $args['discount_code'] ) ? $args['discount_code'] : array();
$startdate = ! empty( $args['startdate'] ) ? $args['startdate'] : '';
$enddate = ! empty( $args['enddate'] ) ? $args['enddate'] : '';
$l = ! empty( $args['l'] ) ? (int) $args['l'] : '';
$l = ! empty( $args['l'] ) ? $args['l'] : array();

//testing or live data
$gateway_environment = get_option( "pmpro_gateway_environment");
Expand Down Expand Up @@ -168,11 +168,22 @@ function pmpro_report_sales_data( $args ){
if(!empty($enddate))
$sqlQuery .= "AND mo1.timestamp <= DATE_ADD( '" . esc_sql( $enddate ) . " 23:59:59' , INTERVAL - " . esc_sql( $tz_offset ) . " SECOND )";

if(!empty($l))
$sqlQuery .= "AND mo1.membership_id IN(" . $l . ") "; // $l is already escaped. See declaration.
if ( ! empty( $l ) ) {
if ( is_array( $l ) ) {
$l_escaped = implode( ',', array_map( 'intval', $l ) );
} else {
$l_escaped = (int) $l;
}
$sqlQuery .= "AND mo1.membership_id IN(" . $l_escaped . ") "; // $l_escaped is already escaped. See above.
}

if ( ! empty( $discount_code ) ) {
$sqlQuery .= "AND dc.code_id = '" . esc_sql( $discount_code ) . "' ";
if ( is_array( $discount_code ) ) {
$discount_code_escaped = implode( ',', array_map( 'intval', $discount_code ) );
} else {
$discount_code_escaped = (int) $discount_code;
}
$sqlQuery .= "AND dc.code_id IN(" . $discount_code_escaped . ") "; // $discount_code_escaped is already escaped. See above.
}

$sqlQuery .= " GROUP BY mo1.id ";
Expand Down Expand Up @@ -217,15 +228,23 @@ function pmpro_report_sales_page()
}

if( ! empty( $_REQUEST['level'] ) ) {
$l = intval($_REQUEST['level']);
if ( is_array( $_REQUEST['level'] ) ) {
$l = array_map( 'intval', $_REQUEST['level'] );
} else {
$l = array( intval( $_REQUEST['level'] ) );
}
} else {
$l = "";
$l = array();
}

if ( ! empty( $_REQUEST[ 'discount_code' ] ) ) {
$discount_code = intval( $_REQUEST[ 'discount_code' ] );
if ( isset( $_REQUEST[ 'discount_code' ] ) ) {
if ( is_array( $_REQUEST[ 'discount_code' ] ) ) {
$discount_code = array_map( 'intval', $_REQUEST[ 'discount_code' ] );
} else {
$discount_code = array( intval( $_REQUEST[ 'discount_code' ] ) );
}
} else {
$discount_code = '';
$discount_code = array();
}

if ( isset( $_REQUEST[ 'show_parts' ] ) ) {
Expand Down Expand Up @@ -278,6 +297,14 @@ function pmpro_report_sales_page()
$startdate = date( 'Y-m-01', strtotime( current_time( 'mysql' ) . ' -12 month' ) );
// Set the end date to the last day of the previous month.
$enddate = date('Y-m-t', strtotime( current_time( 'mysql' ) . ' -1 month' ) );
} else if ( $period === 'custom' ) {
// Set up the report unit to use.
$report_unit = 'DAY';
$axis_date_format = 'd';
$tooltip_date_format = get_option( 'date_format' );
// Set up the start and end dates.
$startdate = sanitize_text_field( $_REQUEST['custom_start_date'] );
$enddate = sanitize_text_field( $_REQUEST['custom_end_date'] );
} else {
// Set up the report unit to use.
$report_unit = 'YEAR';
Expand Down Expand Up @@ -459,7 +486,7 @@ function pmpro_report_sales_page()
ksort( $dates );

// Save a transient for each combo of params. Expires in 1 hour.
$param_array = array( $period, $type, $month, $year, $l, $discount_code );
$param_array = array( $period, $type, $month, $year, implode( ',', $l ), implode( ',', $discount_code ) );
$param_hash = md5( implode( ' ', $param_array ) . PMPRO_VERSION );
set_transient( 'pmpro_sales_data_' . $param_hash, $csvdata, HOUR_IN_SECONDS );

Expand Down Expand Up @@ -598,7 +625,7 @@ function pmpro_report_sales_page()
<div class="pmpro_report-filters">
<h3><?php esc_html_e( 'Customize Report', 'paid-memberships-pro'); ?></h3>
<div class="tablenav top">
<span><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show Period', 'paid-memberships-pro' ); ?></span>
<span class="pmpro_report-filter-text"><?php echo esc_html_x( 'Show', 'Dropdown label, e.g. Show Period', 'paid-memberships-pro' ); ?></span>
<label for="period" class="screen-reader-text"><?php esc_html_e( 'Select report time period', 'paid-memberships-pro' ); ?></label>
<select id="period" name="period">
<option value="daily" <?php selected($period, "daily");?>><?php esc_html_e('Daily', 'paid-memberships-pro' );?></option>
Expand All @@ -607,13 +634,14 @@ function pmpro_report_sales_page()
<option value='7days' <?php selected( $period, '7days' ); ?>><?php esc_html_e( 'Last 7 Days', 'paid-memberships-pro' ); ?></option>
<option value='30days' <?php selected( $period, '30days' ); ?>><?php esc_html_e( 'Last 30 Days', 'paid-memberships-pro' ); ?></option>
<option value='12months' <?php selected( $period, '12months' ); ?>><?php esc_html_e( 'Last 12 Months', 'paid-memberships-pro' ); ?></option>
<option value='custom' <?php selected( $period, 'custom' ); ?>><?php esc_html_e( 'Custom Range', 'paid-memberships-pro' ); ?></option>
</select>
<label for="type" class="screen-reader-text"><?php esc_html_e( 'Select report type', 'paid-memberships-pro' ); ?></label>
<select id="type" name="type">
<option value="revenue" <?php selected($type, "revenue");?>><?php esc_html_e('Revenue', 'paid-memberships-pro' );?></option>
<option value="sales" <?php selected($type, "sales");?>><?php esc_html_e('Sales', 'paid-memberships-pro' );?></option>
</select>
<span id="for"><?php esc_html_e('for', 'paid-memberships-pro' )?></span>
<span id="for" class="pmpro_report-filter-text"><?php esc_html_e('for', 'paid-memberships-pro' )?></span>
<label for="month" class="screen-reader-text"><?php esc_html_e( 'Select report month', 'paid-memberships-pro' ); ?></label>
<select id="month" name="month">
<?php for($i = 1; $i < 13; $i++) { ?>
Expand All @@ -626,45 +654,63 @@ function pmpro_report_sales_page()
<option value="<?php echo esc_attr( $i );?>" <?php selected($year, $i);?>><?php echo esc_html( $i );?></option>
<?php } ?>
</select>
<span id="for"><?php esc_html_e('for', 'paid-memberships-pro' )?></span>
<span class="pmpro_report-filter-text pmpro-sales-report-custom"><?php esc_html_e('from', 'paid-memberships-pro' )?></span>
<label for="custom_start_date" class="screen-reader-text pmpro-sales-report-custo"><?php esc_html_e( 'Select report start date', 'paid-memberships-pro' ); ?></label>
<input type="date" id="custom_start_date" name="custom_start_date" class="pmpro-sales-report-custom" value="<?php echo esc_attr( $startdate ); ?>" />
<span class="pmpro_report-filter-text pmpro-sales-report-custom"><?php esc_html_e('to', 'paid-memberships-pro' )?></span>
<label for="custom_end_date" class="screen-reader-text pmpro-sales-report-custo"><?php esc_html_e( 'Select report end date', 'paid-memberships-pro' ); ?></label>
<input type="date" id="custom_end_date" name="custom_end_date" class="pmpro-sales-report-custom" value="<?php echo esc_attr( $enddate ); ?>" />
<span id="for" class="pmpro_report-filter-text"><?php esc_html_e('for', 'paid-memberships-pro' )?></span>
<label for="level" class="screen-reader-text"><?php esc_html_e( 'Filter report by membership level', 'paid-memberships-pro' ); ?></label>
<select id="level" name="level">
<option value="" <?php if(!$l) { ?>selected="selected"<?php } ?>><?php esc_html_e('All Levels', 'paid-memberships-pro' );?></option>
<select id="level" name="level[]" multiple>
<?php
$levels = $wpdb->get_results("SELECT id, name FROM $wpdb->pmpro_membership_levels ORDER BY name");
$levels = pmpro_sort_levels_by_order( $levels );
foreach($levels as $level)
{
?>
<option value="<?php echo esc_attr( $level->id ); ?>" <?php if($l == $level->id) { ?>selected="selected"<?php } ?>><?php echo esc_html( $level->name); ?></option>
<option value="<?php echo esc_attr( $level->id ); ?>" <?php if ( in_array( $level->id, $l ) ) { ?>selected="selected"<?php } ?>><?php echo esc_html( $level->name); ?></option>
<?php
}
?>
</select>
</select>
<?php
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->pmpro_discount_codes ";
$sqlQuery .= "ORDER BY id DESC ";
$codes = $wpdb->get_results($sqlQuery, OBJECT);
if ( ! empty( $codes ) ) { ?>
<label for="discount_code" class="screen-reader-text"><?php esc_html_e( 'Filter report by discount code', 'paid-memberships-pro' ); ?></label>
<select id="discount_code" name="discount_code">
<option value="" <?php if ( empty( $discount_code ) ) { ?>selected="selected"<?php } ?>><?php esc_html_e('All Codes', 'paid-memberships-pro' );?></option>
<select id="discount_code" name="discount_code[]" multiple>
<?php foreach ( $codes as $code ) { ?>
<option value="<?php echo esc_attr( $code->id ); ?>" <?php selected( $discount_code, $code->id ); ?>><?php echo esc_html( $code->code ); ?></option>
<option value="<?php echo esc_attr( $code->id ); ?>" <?php if ( in_array( $code->id, $discount_code ) ) { ?>selected="selected"<?php } ?>><?php echo esc_html( $code->code ); ?></option>
<?php } ?>
</select>
<?php } ?>
<script>
// Make the level and discount code fields select2.
jQuery(document).ready(function() {
jQuery('#level').select2({
placeholder: '<?php esc_html_e( 'All Levels', 'paid-memberships-pro' ); ?>',
allowClear: true,
width: '200px'
});
jQuery('#discount_code').select2({
placeholder: '<?php esc_html_e( 'All Codes', 'paid-memberships-pro' ); ?>',
allowClear: true,
width: '200px'
});
});
</script>
<label for="show_parts" class="screen-reader-text"><?php esc_html_e( 'Select report data to include', 'paid-memberships-pro' ); ?></label>
<select id="show_parts" name="show_parts">
<option value='new_renewals' <?php selected( $new_renewals, 'new_renewals' ); ?> ><?php esc_html_e( 'Show New and Renewals', 'paid-memberships-pro' ); ?></option>
<option value='only_new' <?php selected( $new_renewals, 'only_new' ); ?> ><?php esc_html_e( 'Show Only New', 'paid-memberships-pro' ); ?></option>
<option value='only_renewals' <?php selected( $new_renewals, 'only_renewals' ); ?> ><?php esc_html_e( 'Show Only Renewals', 'paid-memberships-pro' ); ?></option>
</select>
<input type="hidden" name="page" value="pmpro-reports" />
<input type="hidden" name="report" value="sales" />
<input type="submit" class="button button-primary action" value="<?php esc_attr_e('Generate Report', 'paid-memberships-pro' );?>" />
<br class="clear" />
</div> <!-- end tablenav -->
<input type="hidden" name="page" value="pmpro-reports" />
<input type="hidden" name="report" value="sales" />
<input type="submit" class="button button-primary action" value="<?php esc_attr_e('Generate Report', 'paid-memberships-pro' );?>" />
</div> <!-- end pmpro_report-filters -->
<div class="pmpro_chart_area">
<div id="chart_div"></div>
Expand All @@ -686,18 +732,27 @@ function pmpro_ShowMonthOrYear()
jQuery('#for').show();
jQuery('#month').show();
jQuery('#year').show();
jQuery('.pmpro-sales-report-custom').hide();
}
else if(period == 'monthly')
{
jQuery('#for').show();
jQuery('#month').hide();
jQuery('#year').show();
jQuery('.pmpro-sales-report-custom').hide();
}
else if ( period == 'custom' ) {
jQuery('.pmpro-sales-report-custom').show();
jQuery('#for').hide();
jQuery('#month').hide();
jQuery('#year').hide();
}
else
{
jQuery('#for').hide();
jQuery('#month').hide();
jQuery('#year').hide();
jQuery('.pmpro-sales-report-custom').hide();
}
}

Expand Down
26 changes: 17 additions & 9 deletions adminpages/sales-csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,28 @@
$year = $thisyear;
}

if ( ! empty( $_REQUEST['level'] ) ) {
$l = intval($_REQUEST['level']);
if( ! empty( $_REQUEST['level'] ) ) {
if ( is_array( $_REQUEST['level'] ) ) {
$l = array_map( 'intval', $_REQUEST['level'] );
} else {
$l = array( intval( $_REQUEST['level'] ) );
}
} else {
$l = "";
$l = array();
}

if ( ! empty( $_REQUEST['discount_code'] ) ) {
$discount_code = intval( $_REQUEST[ 'discount_code' ] );
if( ! empty( $_REQUEST['discount_code'] ) ) {
if ( is_array( $_REQUEST['discount_code'] ) ) {
$discount_code = array_map( 'intval', $_REQUEST['discount_code'] );
} else {
$discount_code = array( intval( $_REQUEST['discount_code'] ) );
}
} else {
$discount_code = '';
$discount_code = array();
}

// Same param hash as found in reports/sales.php.
$param_array = array( $period, $type, $month, $year, $l, $discount_code );
$param_array = array( $period, $type, $month, $year, implode( ',', $l ), implode( ',', $discount_code ) );
$param_hash = md5( implode( ' ', $param_array ) . PMPRO_VERSION );
$sales_data = get_transient( 'pmpro_sales_data_' . $param_hash );

Expand All @@ -69,10 +77,10 @@
$filename .= '_' . $year;
}
if ( ! empty( $l ) ) {
$filename .= "_level" . $l;
$filename .= "_level" . implode( '-', $l );
}
if ( ! empty( $discount_code ) ) {
$filename .= "_" . $discount_code;
$filename .= "_dc" . implode( '-', $discount_code );
}
$filename .= ".csv";
/*
Expand Down
6 changes: 5 additions & 1 deletion classes/class-pmpro-discount-code-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ public function column_discount_code( $item ) {

?>
<strong><a title="<?php echo esc_attr( sprintf( __( 'Edit Code: %s', 'paid-memberships-pro' ), $item->id ) ); ?>" href="<?php echo esc_url( add_query_arg( array( 'page' => 'pmpro-discountcodes', 'edit' => $item->id ), admin_url('admin.php' ) ) ); ?>"><?php echo esc_html( $item->code ); ?></a></strong>
<button title="<?php echo esc_attr__('Copy code to the clipboard', 'paid-memberships-pro' ) ?>" type="button"
class="pmpro_copy_discount_code pmpro_copy_to_clipboard button-link edit-filters" style="display:none">
<span class="dashicons dashicons-clipboard" aria-hidden="true"></span>
</button>
<div class="row-actions">
<?php
$delete_text = esc_html(
Expand Down Expand Up @@ -422,7 +426,7 @@ public function column_discount_code( $item ) {
admin_url( 'admin.php' )
)
),
esc_html__( 'Copy', 'paid-memberships-pro' )
esc_html__( 'Duplicate', 'paid-memberships-pro' )
),
'delete' => sprintf(
'<a title="%1$s" href="%2$s">%3$s</a>',
Expand Down
17 changes: 16 additions & 1 deletion classes/class-pmpro-orders-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,10 @@ public function column_order_id( $item ) {
public function column_order_code( $item ) {
?>
<strong><a href="admin.php?page=pmpro-orders&order=<?php echo esc_attr( $item->id ); ?>"><?php echo esc_html( $item->code ); ?></a></strong>
<button title="<?php echo esc_attr__('Copy code to the clipboard', 'paid-memberships-pro' ) ?>" type="button"
class="pmpro_copy_order_id pmpro_copy_to_clipboard button-link edit-filters" style="display:block">
<span class="dashicons dashicons-clipboard" aria-hidden="true"></span>
</button>
<div class="row-actions">
<?php
$delete_text = esc_html(
Expand Down Expand Up @@ -1239,7 +1243,18 @@ public function column_transaction_ids( $item ) {

// Echo the data for this column.
foreach( $column_value as $key => $value ) {
echo '<p>' . wp_kses_post( $value ) . '</p>';
echo '<p>' .
wp_kses_post( $value );
//we don't want to show the copy button for the empty column
if( $key !== 'none') {
?>
<button title="<?php echo esc_attr( sprintf( __( 'Copy the %s to the clipboard', 'paid-memberships-pro' ), $key ) ) ?>" type="button"
class="pmpro_copy_<? echo esc_attr( $key ) ?> pmpro_copy_to_clipboard button-link edit-filters" style="display:none">
<span class="dashicons dashicons-clipboard" aria-hidden="true"></span>
</button>
<?php
}
echo '</p>';
}
}

Expand Down
Loading