Pdf::add_link( string $file, string $name, Tribe__Template $template )
Add link.
Contents
Parameters
- $file
-
(string) (Required) Path to the file.
- $name
-
(string) (Required) Name of the file.
- $template
-
(Tribe__Template) (Required) Template instance.
Return
(void)
Source
File: src/Events_Virtual/Integrations/Plugins/Tickets_Wallet_Plus/Passes/Pdf.php
public function add_link( $file, $name, $template ): void {
if ( ! $template instanceof \Tribe__Template ) {
return;
}
$args = $template->get_local_values();
// Check if event exists.
if ( ! isset( $args['event'] ) ) {
return;
}
// Check if user wants link in email.
if ( empty( $args['event']->virtual_ticket_email_link ) ) {
return;
}
$virtual_url = empty( $args['event']->virtual_meeting_url ) ? $args['event']->virtual_url : $args['event']->virtual_meeting_url;
// Convert event to WP_Post before filtering.
$event = new WP_Post( $args['event'] );
/**
* Allows filtering the url used in ticket and rsvp emails.
*
* @since 1.15.0
*
* @param string $virtual_url The virtual url for the ticket and rsvp emails.
* @param WP_Post $event The event post object with properties added by the `tribe_get_event` function.
*/
$virtual_url = apply_filters( 'tec_events_virtual_ticket_email_url', $virtual_url, $event );
$args = [
'virtual_url' => $virtual_url,
'virtual_event_icon_src' => tribe( Virtual_Events::class )->plugin_path . 'src/resources/images/alert.png',
];
$this->get_template()->template( 'pass/body/virtual-event/link', $args, true );
}
Changelog
| Version | Description |
|---|---|
| 1.15.5 | Introduced. |