Skip to content

Commit

Permalink
Display back button only in print view; send back to same report rath…
Browse files Browse the repository at this point in the history
…er than root
  • Loading branch information
joedolson committed Dec 26, 2023
1 parent 3c2f41c commit f7548ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mt-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ function mt_reports_page() {
$event_id = (int) $_GET['event_id'];
$report_type = ( isset( $_GET['mt-event-report'] ) && 'tickets' === $_GET['mt-event-report'] ) ? 'tickets' : 'purchases';
$print_report_url = admin_url( 'admin.php?page=mt-reports&event_id=' . $event_id . '&mt-event-report=' . $report_type . '&format=view&mt_print=true' );
$back_url = admin_url( apply_filters( 'mt_printable_report_back', 'admin.php?page=mt-reports' ) );
echo wp_kses_post( '<p><a class="button print-button" href="' . esc_url( $print_report_url ) . '">' . __( 'Print this report', 'my-tickets' ) . '</a><a class="mt-back button" href="' . esc_url( $back_url ) . '">' . __( 'Return to My Tickets Reports', 'my-tickets' ) . '</a></p>' );
$back_url = admin_url( apply_filters( 'mt_printable_report_back', 'admin.php?page=mt-reports&mt-event-report=' . $report_type . '&event_id=' . $event_id ) );
$return = ( isset( $_GET['mt_print'] ) ) ? '<a class="mt-back button" href="' . esc_url( $back_url ) . '">' . __( 'Return to My Tickets Reports', 'my-tickets' ) . '</a>' : '';
echo wp_kses_post( '<p><a class="button print-button" href="' . esc_url( $print_report_url ) . '">' . __( 'Print this report', 'my-tickets' ) . '</a> ' . $return . '</p>' );
}
?>
<div class="mt-report-selector">
Expand Down

0 comments on commit f7548ae

Please sign in to comment.