Tribe__Tickets__Attendees::event_action_links( $event_id )
Injects action links into the attendee screen.
Contents
Parameters
- $event_id
-
(Required)
Source
File: src/Tribe/Attendees.php
public function event_action_links( $event_id ) {
/**
* Allows for control of the specific "edit post" URLs used for event Sales and Attendees Reports.
*
* @since 4.6.2
*
* @param string $link The deafult "edit post" URL.
* @param int $event_id The Post ID of the event.
*/
$edit_post_link = apply_filters( 'tribe_tickets_event_action_links_edit_url', get_edit_post_link( $event_id ), $event_id );
$post = get_post( $event_id );
$pto = get_post_type_object( $post->post_type );
$singular = $pto->labels->singular_name;
$edit = esc_html( sprintf( _x( 'Edit %s', 'attendee event actions', 'event-tickets' ), $singular ) );
$view = esc_html( sprintf( _x( 'View %s', 'attendee event actions', 'event-tickets' ), $singular ) );
$action_links = array(
'<a href="' . esc_url( $edit_post_link ) . '" title="' . esc_attr_x( 'Edit', 'attendee event actions', 'event-tickets' ) . '">' . $edit . '</a>',
'<a href="' . esc_url( get_permalink( $event_id ) ) . '" title="' . esc_attr_x( 'View', 'attendee event actions', 'event-tickets' ) . '">' . $view . '</a>',
);
/**
* Provides an opportunity to add and remove action links from the attendee screen summary box.
*
* @param array $action_links
* @param int $event_id
*/
$action_links = (array) apply_filters( 'tribe_tickets_attendees_event_action_links', $action_links, $event_id );
if ( empty( $action_links ) ) {
return;
}
echo wp_kses_post( '<li class="event-actions">' . implode( ' | ', $action_links ) . '</li>' );
}
Changelog
| Version | Description |
|---|---|
| 4.6.2 | Introduced. |