Last active
February 27, 2017 18:53
-
-
Save cliffordp/f95b520a71635fd4e9d73eb2af73bd5e to your computer and use it in GitHub Desktop.
Event Tickets: Move the Tickets View ("You have X RSVPs and X tickets for this Event. View your RSVPs and Tickets") to a different location on the Event Single page * Event Tickets Plus: Move the Attendees List ("Who's Attending") to a different location on the Event Single page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Event Tickets: Move the Tickets View ("You have X RSVPs and X tickets for this Event. View your RSVPs and Tickets") to a different location on the Event Single page | |
* Event Tickets Plus: Move the Attendees List ("Who's Attending") to a different location on the Event Single page | |
* From https://gist.github.com/cliffordp/f95b520a71635fd4e9d73eb2af73bd5e | |
**/ | |
add_action( 'init', 'cliff_et_move_tickets_view_and_attendees_list' ); | |
function cliff_et_move_tickets_view_and_attendees_list() { | |
/* Event Tickets Plus: Attendees List */ | |
if ( class_exists( 'Tribe__Tickets_Plus__Attendees_List' ) ) { | |
// Remove the form from its default location (after the meta). | |
remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Tickets_Plus__Attendees_List::instance(), 'render' ), 4 ); | |
// Add the form to its new location (before the content). | |
/* | |
could use different actions to output to different places on event single page | |
-- see /wp-content/plugins/the-events-calendar/src/views/single-event.php for more actions | |
-- also listed below: | |
tribe_events_single_event_before_the_content | |
tribe_events_single_event_after_the_content | |
tribe_events_single_event_before_the_meta | |
tribe_events_single_event_after_the_meta | |
*/ | |
add_action( 'tribe_events_single_event_before_the_content', array( Tribe__Tickets_Plus__Attendees_List::instance(), 'render' ) ); | |
} | |
/* Event Tickets: Your Tickets View */ | |
if ( class_exists( 'Tribe__Tickets__Tickets_View' ) ) { | |
// Remove the form from its default location (after the meta). | |
remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Tickets__Tickets_View::instance(), 'inject_link_template' ), 4 ); | |
// Add the form to its new location (before the content). | |
/* | |
could use different actions to output to different places on event single page | |
-- see /wp-content/plugins/the-events-calendar/src/views/single-event.php for more actions | |
-- also listed below: | |
tribe_events_single_event_before_the_content | |
tribe_events_single_event_after_the_content | |
tribe_events_single_event_before_the_meta | |
tribe_events_single_event_after_the_meta | |
*/ | |
add_action( 'tribe_events_single_event_before_the_content', array( Tribe__Tickets__Tickets_View::instance(), 'inject_link_template' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment