Skip to content

Instantly share code, notes, and snippets.

View nefeline's full-sized avatar
:octocat:
Work, work!

Patricia Hillebrandt nefeline

:octocat:
Work, work!
View GitHub Profile
@nefeline
nefeline / functions.php
Last active July 7, 2018 12:43
Unregisters the Google Maps API script on Events Calendar PRO.
<?php
/**
* Unregisters the Google Maps API on Events Calendar PRO.
*/
add_action( 'wp_print_scripts', 'ecp_remove_google_maps_api', 100 );
function ecp_remove_google_maps_api() {
wp_deregister_script( 'tribe-gmaps' );
}
@nefeline
nefeline / functions.php
Last active June 6, 2018 23:00
Disable the Rest API for The Events Calendar
<?php
/**
* Disable the Rest API for The Events Calendar
*/
add_filter( 'tribe_events_rest_api_enabled', '__return_false' );
add_action( 'init', 'disable_rest_api' );
function disable_rest_api(){
remove_action( 'rest_api_init', array( tribe( 'tec.rest-v1.main' ), 'register_endpoints' ) );
}
@nefeline
nefeline / customize-notice-there-were-no-results-found.php
Last active June 17, 2019 16:37
Changes the "There were no results found" text on TEC.
<?php
/**
* Change the "There were no results found" text on TEC.
*/
add_filter( 'tribe_the_notices', 'change_notice', 10, 2 );
function change_notice( $html ) {
if ( stristr( $html, 'There were no results found.' ) ) {
//Replace 'Your custom message' with the text you want.
$html = str_replace( 'There were no results found.', 'Your custom message', $html );
@nefeline
nefeline / bulk_delete_events.sql
Last active November 28, 2018 20:03
Permanently Delete Events before a specific Event End Date
/* Use this SQL Query to permanently delete all events before a specific Event End Date.
Author: Patricia Hillebrandt
Date: 02/14/2018
*/
DELETE t1
FROM wp_posts AS t1
INNER JOIN wp_postmeta AS t2
ON t1.ID = t2.post_id
WHERE t1.post_type = 'tribe_events'
AND t2.meta_key = '_EventEndDate'
@nefeline
nefeline / move_to_trash.sql
Last active February 14, 2018 23:33
Move Events to Trash before a specific Event End Date
/* Use this SQL Query to move all events before a specific Event End Date to trash.
Author: Patricia Hillebrandt
Date: 02/14/2018
*/
UPDATE wp_posts AS t1
INNER JOIN wp_postmeta AS t2
ON t1.ID = t2.post_id
SET t1.post_status = 'trash'
WHERE t1.post_type = 'tribe_events'
AND t2.meta_key = '_EventEndDate'
@nefeline
nefeline / custom_setup_keyword_search_in_bar.php
Last active December 14, 2017 14:13
This Snippet allows you to modify the keyword search in the tribe events bar
<?php
/**
* This Snippet allows you to modify the keyword search in the tribe events bar
* Author: Patricia Hillebrandt
* Date: 14/12/17
*/
add_filter( 'tribe-events-bar-filters', 'custom_setup_keyword_search_in_bar', 10 );
function custom_setup_keyword_search_in_bar( $filters ) {
<?php
/**
* This Snippet allows you to modify/translate the Buy Now button and "tickets left" texts
* Author: Patricia Hillebrandt
* Date: 13/12/17
*/
add_filter( 'tribe_tickets_buy_button', 'translate_button_text', 11, 2 );
function translate_button_text( $html ) {
@nefeline
nefeline / loop.php
Last active November 28, 2017 17:12
List View Calendar - Events grouped by day of the week
<?php
/**
* This template overrides the default List View Loop (in the-events-calendar/src/views/loop.php) and groups events by day of the week.
* Author: Patricia Hillebrandt
*
* Add this file to [your-theme]/tribe-events/list/
* Example: https://theeventscalendar.com/content/uploads/2017/11/Screenshot-from-2017-11-28-15-00-05.png
* Required plugins: The Events Calendar
* Date: 11-28-2017
*
@nefeline
nefeline / remove_select2_library.php
Last active November 22, 2017 16:09
Removes the Select2 library from The Events Calendar
<?php
/**
* Removes Select2 library from The Events Calendar
* By: Patricia Hillebrandt
* Date: 11/22/17
*/
add_action( 'wp_print_scripts', 'tribe_disable_select2', 20 );
add_action( 'admin_enqueue_scripts', 'tribe_disable_select2', 20 );
function tribe_disable_select2() {
<?php
/**
* Dequeue tribe-events-ajax-maps.js file.
* Author: Patricia Hillebrandt
* Date: 11/21/17
*/
add_action( 'wp_print_scripts', 'dequeue_map_script', 100 );
function dequeue_map_script() {
wp_dequeue_script( 'tribe-events-pro-geoloc' );
wp_deregister_script( 'tribe-events-pro-geoloc' );