Skip to content

Instantly share code, notes, and snippets.

@elimn
elimn / tec-country-list.txt
Created November 22, 2016 16:54
MT | TEC | Country List
This is a country list, containing all the countries in the Tribe Plugins.
If you are running Events Calendar Pro and would like to remove one or more
of them from the available options for new events, copy/paste the following into
WP Admin > Events > Settings > Default Content > Use a custom list of countries
Then delete every country you do not need.
==COPY/PASTE EVERYTHING AFTER THIS LINE==
US, United States
AF, Afghanistan
AL, Albania
@elimn
elimn / tribe_hide_ticket_moved_emails.php
Created November 16, 2016 20:51
MT | ET | Prevent ticket moved emails from reaching the customer
<?php
/**
* Returns a black hole email address
*
* @see https://en.wikipedia.org/wiki/Black_hole_(networking)#Black_hole_e-mail_addresses
*
* @return string
*/
function tribe_return_blackhole_email() {
@elimn
elimn / tribe_alter_recurrence_rebuild_schedule.php
Created November 10, 2016 22:38
MT | ECP | Have ECP append and trim recurrences every hour instead of every day
<?php
/**
* Tells ECP to append and trim recurrences every hour instead of every day.
*
* @see (wp filter) schedule_event
*
* @return mixed
*/
function tribe_alter_recurrence_rebuild_schedule( $event ) {
@elimn
elimn / tribe_photo_posts_per_page.php
Created October 24, 2016 20:14
MT | ECP | Set the events per page on photo view
<?php
/**
* Set the events per page on photo view.
*/
function tribe_photo_posts_per_page( $value, $name, $default ){
if ( 'postsPerPage' === $name && tribe_is_photo() ) {
$value = '30';
}
return $value;
@elimn
elimn / tribe_remove_venue_org_links.php
Created October 20, 2016 02:56
MT | ECP | Remove the frontend links to the venue and organizer pages when Pro is active.
@elimn
elimn / tribe_single_hide_cost.php
Last active October 5, 2016 17:27
MT | TEC | Hide cost from the single event details section
<?php
/**
* Hides cost from the single event details section
*
* @param string $tpl Template relative path
*/
function tribe_single_hide_cost( $tpl ) {
if ( 'modules/meta/details.php' === $tpl ) {
add_filter( 'tribe_get_formatted_cost', '__return_empty_string' );
@elimn
elimn / Tribe__Extension__Community_Events_Edit_Status.php
Created October 4, 2016 13:33
MT | CE | Set status of Community Events to the default status after they have been edited
<?php
/**
* Sets the status of Community Events to the default status after they have been edited
*
* When you set Community submitted events to a status like "Pending Review" and a
* user submits a new event, it will be marked Pending Review and will not be visible
* until an admin publishes it. However if a user edits this event after it has been
* published, it will stay published. With this code it will instead go to Pending Review
* and will again be removed from public view until an admin republishes the event.
@elimn
elimn / tribe_limit_get_terms.php
Last active September 2, 2016 09:23
MT | ECP | Limit the number of tags visible to ECP widget filters in WP Admin
/*
* Limits the number of tags visible to the TEC widget filter in WP Admin
*
* Useful for when your site has loads of tags. Which causes WP Admin > Widgets
* page to load very slowly or not at all.
*/
function tribe_limit_get_terms( $terms, $taxonomy, $query_vars, $term_query ) {
if( ! is_admin() ) return $terms;
@elimn
elimn / tribe_prevent_fb_img_import.php
Created August 24, 2016 16:42
MT | TEC | Prevent Facebook importer from importing images
<?php
/*
* Prevent Facebook importer from importing images
* Useful fore countries where laws such as copyright can make this a problem
*/
add_filter( 'tribe_fb_event_img', '__return_false' );
@elimn
elimn / tribe_str_replace.php
Last active August 12, 2016 01:36
MT | Swap every instance of a word for another
<?php
/*
* SWAP EVERY INSTANCE OF A WORD FOR ANOTHER
* 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'...
*/
function tribe_str_replace ( $translation, $text, $domain ) {