Tribe__Tickets_Plus__Commerce__EDD__Main::get_event_reports_link( int $post_id, bool $url_only = false )
Insert a link to the report.
Contents
Parameters
- $post_id
-
(int) (Required) The post ID.
- $url_only
-
(bool) (Optional) Whether to return the URL only.
Default value: false
Return
(string)
Source
File: src/Tribe/Commerce/EDD/Main.php
public function get_event_reports_link( $post_id ) {
$ticket_ids = $this->get_tickets_ids( $post_id );
if ( empty( $ticket_ids ) ) {
return '';
}
$term = get_term_by( 'name', 'Ticket', 'download_category' );
ob_start();
?>
<small>
<a href="<?php echo esc_url( admin_url( 'edit.php?view=downloads&post_type=download&page=edd-reports&category=' . $term->term_id . '&event=' . $post_id ) ); ?>"
id="eddtickets_event_reports"><?php esc_html_e( 'Event sales report', 'event-tickets-plus' ); ?></a>
</small>
<?php
return ob_get_clean();
}
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |