Template_Modifications::render_share_ticket_controls( TribeEventsVirtualCompatibilityEvent_TicketsWP_Post|null $event = null, boolean $echo = true )
Render the virtual event share controls.
Contents
Parameters
- $event
-
(TribeEventsVirtualCompatibilityEvent_TicketsWP_Post|null) (Optional) The event post we are editing.
Default value: null
- $echo
-
(boolean) (Optional) To echo or not to echo, that is the question.
Default value: true
Return
(string|false) Either the final content HTML or false if no template could be found.
Source
File: src/Tribe/Compatibility/Event_Tickets/Template_Modifications.php
public function render_share_ticket_controls( $event = null, $echo = true ) {
$event = tribe_get_event( $event );
if ( ! $event instanceof \WP_Post ) {
return false;
}
$provider = Tickets::get_event_ticket_provider( $event->ID );
// For some ET backwards compatibility.
$provider = is_object( $provider ) ? $provider->class_name : $provider;
if ( empty( $provider ) ) {
return false;
}
if ( 'Tribe__Tickets__RSVP' === $provider ) {
return false;
}
if ( ! array_key_exists( $provider, Tickets::modules() ) ) {
return false;
}
return $this->template->template(
'virtual-metabox/container/compatibility/event-tickets/share-tickets',
[
'post' => $event,
'metabox_id' => Metabox::$id,
],
$echo
);
}
Changelog
| Version | Description |
|---|---|
| 1.0.4 | Introduced. |