Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / day.php
Last active Jul 9, 2021 — forked from skyshab/day.php
Add a class to month view day-cells when they contain events, and when they are not the main month.
View day.php
<?php
/**
* View: Month View - Day
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/events/v2/month/calendar-body/day.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy
@andrasguseo
andrasguseo / dequeue-tribe-events-styles-scripts.php
Created Jun 26, 2019 — forked from samkent/dequeue-tribe-events-styles-scripts.php
Dequeue Tribe Events (The Events Calendar) scripts and styles if not calendar or event page
View dequeue-tribe-events-styles-scripts.php
<?php
/**
* Detect Tribe Events page
* @link https://wordpress.stackexchange.com/questions/340515/writing-a-function-to-detect-an-event
*/
function is_tribe_calendar() {
if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular( 'tribe_events' )) {
return true;
}
else {
@andrasguseo
andrasguseo / experimental-smart-month-search.php
Created Jun 5, 2018 — forked from barryhughes/experimental-smart-month-search.php
Improve month view search so it is not restricted to the current month. Experimental! Use at own risk, there are known bugs/quirks with this code.
View experimental-smart-month-search.php
<?php
/**
* If a search is conducted in month view but the relevant events
* are in a different month, switch to that month.
*
* Experimental! Especially during live ajax navigation, there are
* parts of this that don't work cleanly (pushstate/URL changes).
* Unsupported, use at own risk.
*/
class Transmogrified_Month_View_Search {
View temp-fix-bug-97829.php
<?php
function ecp_fix_tag_order( $sql, $query ) {
// Only modify the main query, if it is a tag archive query
if ( ! $query->is_main_query() || ! $query->is_tag() ) {
return $sql;
}
$has_event_start_date = (bool) strpos( $sql, 'AS EventStartDate' );
$orders_by_post_date = (bool) strpos( $sql, 'ORDER BY post_date DESC' );
@andrasguseo
andrasguseo / add_bcc_to_certain_emails.php
Last active Mar 6, 2018 — forked from jessepearson/add_bcc_to_certain_emails.php
Add a BCC to certain defined emails sent from WooCommerce
View add_bcc_to_certain_emails.php
<?php // only copy this line if needed
/**
* Function adds a BCC header to emails that match our array
*
* Plugins: WooCommerce
* Original Author: Jesse Pearson (https://gist.github.com/jessepearson)
* Modified by: Andras Guseo
* Last updated: March 5, 2018
*
@andrasguseo
andrasguseo / tribe_attachment_404_fix.php
Last active Jul 30, 2020 — forked from elimn/tribe_attachment_404_fix.php
MT | TEC | Fix for Single Event 404s with attachment set in WP Query
View tribe_attachment_404_fix.php
<?php
/*
* Possible solution for Single Event page 404 errors where the WP_Query has an attachment set
* IMPORTANT: Flush permalinks after pasting this code: http://tri.be/support/documentation/troubleshooting-404-errors/
* Updated to work with post 3.10 versions
*/
function tribe_attachment_404_fix () {
if (class_exists('Tribe__Events__Main')) {
remove_action( 'init', array( Tribe__Events__Main::instance(), 'init' ), 10 );
@andrasguseo
andrasguseo / functions.php
Created Nov 1, 2017 — forked from cliffordp/functions.php
BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
View functions.php
<?php
/**
* BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/c4fb2ea8fb5ca44973ff06e6facc9742
* A fork of https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
* For https://theeventscalendar.com/support/forums/topic/event-tickets-free-not-plus-rsvp-notifications/#post-1272819
*
* @link https://developer.wordpress.org/reference/functions/wp_mail/#comment-349
*/
@andrasguseo
andrasguseo / functions.php
Created Nov 1, 2017 — forked from cliffordp/functions.php
BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
View functions.php
<?php
/**
* BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
*
* Reference: https://developer.wordpress.org/reference/functions/wp_mail/#using-headers-to-set-from-cc-and-bcc-parameters
*
*/
function cliff_et_rsvp_bcc_admin_ticket() {