Home › Forums › Calendar Products › Events Calendar PRO › Custom code on Events Calendar 3.11.2
- This topic has 6 replies, 3 voices, and was last updated 10 years, 8 months ago by
Support Droid.
-
AuthorPosts
-
August 10, 2015 at 1:11 am #994666
Carl
ParticipantHello,
I have the following custom code in my functions.php file for the Events Calendar as well as Tickets. Will it still work on Events Calendar 3.11.2?:
remove_action( 'tribe_events_single_event_after_the_meta', array( TribeWooTickets::get_instance(), 'front_end_tickets_form'), 5 ); add_action( 'tribe_events_single_event_after_the_content', array( TribeWooTickets::get_instance(), 'front_end_tickets_form'), 5 ); // This example replaces "Event" with "Course" in all Tribe Plugins text // See the codex to learn more about WP text domains: // http://codex.wordpress.org/Translating_WordPress#Localization_Technology // Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... add_filter('gettext', 'theme_filter_text', 10, 3); function theme_filter_text( $translations, $text, $domain ) { // If this text domain starts with "tribe-" if(strpos($domain, 'tribe-') === 0) { // Replace upper case, lower case, singular, and plural $text = str_replace( // Text to search for array('Event', 'event', 'Events', 'events'), // Text to replace it with -- change this for your needs array('Course', 'course', 'Courses', 'courses'), $text ); } return $text; } add_filter('ngettext', 'theme_filter_ntext', 10, 5); function theme_filter_ntext( $translation, $single, $plural, $number, $domain ) { // If this text domain starts with "tribe-" if(strpos($domain, 'tribe-') === 0) { // Replace upper case, lower case, singular, and plural if( $number > 1 ) { $plural = str_replace( // Text to search for array('Events', 'events'), // Text to replace it with -- change this for your needs array('Courses', 'courses'), $plural ); return $plural; } else { $single = str_replace( // Text to search for array('Event', 'event'), // Text to replace it with -- change this for your needs array('Course', 'course'), $single ); return $single; } } } add_filter( 'wootickets_email_message', 'replace_wootickets_order_msg' ); function replace_wootickets_order_msg() { return ''; } add_action( 'init', 'stop_wootickets_ticket_email' ); function stop_wootickets_ticket_email() { $callback = array( TribeWooTickets::get_instance(), 'add_email_class_to_woocommerce' ); remove_filter( 'woocommerce_email_classes', $callback ); }August 10, 2015 at 8:13 am #994761Brian
MemberHi,
Thanks for using our plugins.
I tested out the coding and it works with this change: (there is 3 places I saw that class name)
TribeWooTickets
Should be changed to this:
Tribe__Events__Tickets__Woo__Main
Here is what I saw too.
The words Event or Events changed to Course or Courses.
The Ticket Form Moved Up
The Order email did not have a message about tickets sent in another email. Nor did any ticket emails get sent on my test order.
So it looks like you are all set once you change the class name after updating.
I would test on your site after the update and class name changes just to make sure.
Cheers
August 10, 2015 at 8:29 am #994766Carl
ParticipantHi Brian,
Thanks for responding so promptly.
Just to double check do you mean the following code should be changed:
add_action( 'init', 'stop_wootickets_ticket_email' ); function stop_wootickets_ticket_email() { $callback = array( TribeWooTickets::get_instance(), 'add_email_class_to_woocommerce' ); remove_filter( 'woocommerce_email_classes', $callback ); }`add_action( ‘init’, ‘stop_wootickets_ticket_email’ );
function stop_wootickets_ticket_email() {
$callback = array( Tribe__Events__Tickets__Woo__Main::get_instance(), ‘add_email_class_to_woocommerce’ );
remove_filter( ‘woocommerce_email_classes’, $callback );
}-
This reply was modified 10 years, 8 months ago by
Carl.
August 10, 2015 at 11:45 am #994842Brian
MemberYep that is correct.
And these two should be changed too:
remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );
add_action( 'tribe_events_single_event_after_the_content', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );August 12, 2015 at 3:26 am #995322Carl
ParticipantThanks Brian
August 12, 2015 at 7:42 am #995413Brian
MemberYou’re Welcome.
August 27, 2015 at 7:05 am #999529Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
This reply was modified 10 years, 8 months ago by
-
AuthorPosts
- The topic ‘Custom code on Events Calendar 3.11.2’ is closed to new replies.
