Skip to content

Instantly share code, notes, and snippets.

View ni-le's full-sized avatar

Niels Lefeld ni-le

  • Germany
View GitHub Profile
@ni-le
ni-le / EvTic_product_ticket_linker.php
Last active January 12, 2016 20:22
Events Tickets Pro - Link events to existing ticket product
/*
* Add or remove event ids to an existing ticket product
*/
function tribe_link_product_event ( $product_id, $event_id ) {
if ( !in_array($event_id, get_post_meta( $product_id, '_tribe_wooticket_for_event') ) ) {
add_post_meta( $product_id, '_tribe_wooticket_for_event', $event_id );
}
}
function tribe_unlink_product_event ( $product_id, $event_id ) {
@ni-le
ni-le / string_changing_extensions.php
Last active February 17, 2017 21:57
The Events Calendar extended string changer
<?php
/* Additional functions for changing strings in the events calendar and its plugins
* See https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ for details
* on the provided functions by the TEC team
* 1. - function for changing quantity based spelling
* 2. - function for changing strings with an attached context
*/
function tribe_custom_theme_numbered_text ( $translation, $single, $plural, $number, $domain ) {