Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / install-composer
Created April 16, 2024 21:15 — forked from nem-c/install-composer
Composer for DevKinsta
## On you machine run:
docker exec -it devkinsta_fpm bash
## After you are logged change to /tmp
cd /tmp
## Install and configure composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
@andrasguseo
andrasguseo / dropdown.php
Last active October 5, 2023 23:06 — forked from lelandf/dropdown.php
[TEC] Template override to get rid of unwanted filter bar categories
<?php
/**
* View: Dropdown Component
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/events-filterbar/v2_1/components/dropdown.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy
@andrasguseo
andrasguseo / day.php
Last active July 9, 2021 17:10 — 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.
<?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 June 26, 2019 20:38 — forked from samkent/dequeue-tribe-events-styles-scripts.php
Dequeue Tribe Events (The Events Calendar) scripts and styles if not calendar or event page
<?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 June 5, 2018 09:26 — 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.
<?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 {
<?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 March 6, 2018 09:27 — forked from jessepearson/add_bcc_to_certain_emails.php
Add a BCC to certain defined emails sent from WooCommerce
<?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 September 23, 2022 03:23 — forked from elimn/tribe_attachment_404_fix.php
MT | TEC | Fix for Single Event 404s with attachment set in WP Query
<?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 November 1, 2017 21:25 — 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
<?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 November 1, 2017 20:24 — forked from cliffordp/functions.php
BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?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() {