Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
theeventscalendar / ticketsplus_woocommerce-products.php
Last active February 15, 2022 22:38 — forked from elimn/tribe_wootix_no_hijack.php
Allows customers to access the WooCommerce product page for tickets with Tickets Plus
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
@cliffordp
cliffordp / functions.php
Last active February 15, 2022 22:35
Event Tickets Plus v4.6+ - WooCommerce Tickets: Keep all but the lowest-priced WooTicket for each event as Hidden visibility. Change the least-expensive to Visible (Shop and search results). Filter Visible tickets to have a post title of "Tickets for {Event_Name}" while in Shop or Search.
<?php
/*
* Event Tickets Plus v4.6+ - WooCommerce Tickets: Keep all but the lowest-priced
* WooTicket for each event as Hidden visibility. Change the least-expensive to
* Visible (Shop and search results).
*
* This snippet only works with WooCommerce 3.0.0+.
* We could do the same logic on a different action, like when a ticket is
* deleted or an attendee is created / ticket is sold, but this probably isn't
@cliffordp
cliffordp / functions.php
Last active February 6, 2022 13:26
Event Tickets Plus v4.6+: Assign all WooCommerce Tickets to a specific Product Category upon saving (create or update, won't affect old tickets).
<?php
/*
* Event Tickets Plus v4.6+: Assign all WooCommerce Tickets to a specific
* Product Category upon saving (create or update, won't affect old tickets).
*
* !!! YOU NEED TO CHANGE THE CODE TO BE THE PRODUCT CATEGORY ID(S) YOU WANT !!!
*
* @link https://gist.github.com/cliffordp/5bffd372db4ebf14482574ce9bb2479c This snippet.
* @link https://gist.github.com/cliffordp/63abddea69b60f616c1aec1c6bdfc299 Another snippet you might be interested in.
@findingsimple
findingsimple / .htaccess
Created November 28, 2017 07:58
HTTP_AUTHORIZATION modification for WP .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active December 2, 2025 15:44
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@JayHoltslander
JayHoltslander / deactivate-plugins-on-domain.php
Last active April 25, 2023 18:40 — forked from subharanjanm/deactivate-plugins-wpe-staging.php
Deactivate certain Wordpress plugins when running on the development/staging domain
<?php
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$plugins = array(
'wordpress-seo/wp-seo.php',
'broken-link-checker/broken-link-checker.php'
);
if ( strpos(get_site_url(), 'devserver.com') !== false ) {
deactivate_plugins( $plugins );
}
else {
@damiencarbery
damiencarbery / conditional-wc-email-sending.php
Last active July 30, 2023 07:32
Conditionally send WooCommerce emails: Dynamically determine whether to send a WooCommerce email. https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
<?php
/*
Plugin Name: Conditionally send WooCommerce emails
Plugin URI: https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
Description: Dynamically determine whether to send a WooCommerce email.
Author: Damien Carbery
Version: 0.2
*/
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc
@0x8801
0x8801 / export.js
Last active May 31, 2021 09:06
Export Wallet by BudgetBakers records to JSON
// Source for Jake Archibald's idb https://github.com/jakearchibald/idb/blob/v3.0.2/build/idb.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.idb = {}));
}(this, function (exports) { 'use strict';
function toArray(arr) {
return Array.prototype.slice.call(arr);
}
@jessepearson
jessepearson / functions.php
Last active October 7, 2020 13:14
Adds the product link to low and out of stock emails in WooCommerce
<?php // do not copy this line
/**
* Adds the product link to low and out of stock emails in WooCommerce
* @param string $message Message stating low/out of stock.
* @param object $product The product's object the email is for.
* @return string The modified email with the link to edit the product.
*
* @link https://wordpress.org/support/topic/admin-stock-notification-emails/
* @link https://gist.github.com/jessepearson/701386d8ca5e4c84fc7cdf3d5d5391a3
@mrwweb
mrwweb / readme.md
Last active September 27, 2024 22:29
The Events Calendar v2 Template Reset & Customizations - Now on Github