Skip to content

Instantly share code, notes, and snippets.

View codearachnid's full-sized avatar
:octocat:
curiouser and curiouser

Timothy Wood codearachnid

:octocat:
curiouser and curiouser
View GitHub Profile
@NateWr
NateWr / imager-for-wp.php
Created March 12, 2014 01:07
Integrate Imager.js with WordPress
<?php
/**
* Integrate Imager.js with WordPress
*
* Imager.js is BBC's solution for serving responsive and retina images, without
* the double payload issues that affect other solutions. For more information:
*
* https://github.com/BBC-News/Imager.js/
*
* This collection of functions modifies the output of WordPress's
@spivurno
spivurno / gw-gravity-forms-unrequire-required-fields-usage.php
Last active June 13, 2022 20:04
Gravity Wiz // Gravity Forms Unrequire Required Fields for Speedy Testing
<?php
# Basic Usage
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string
# http://youurl.com/your-form-page/?gwunrequire=1
new GWUnrequire();
# Enable for All Users (Including Visitors)
# still requires the 'gwunrequire' parameter be added to the query string
new GWUnrequire( array(
@nekman
nekman / jquery.attrMatcher.js
Last active January 4, 2016 13:49
jQuery attribute matcher.
/**
* http://plnkr.co/edit/Mou8b94hzmuIVjd7b63w?p=preview
*/
(function(global, factory) {
// CommonJS
if (typeof module === 'object') {
module.exports = factory(require('jquery'));
} else if (typeof global.define === 'function') {
// AMD
define(['jquery'], factory);
@codearachnid
codearachnid / tribe-admin-events-list.class.php
Created November 19, 2013 01:03
The Events Calendar: Fixed bug with improper column name when in admin main event list. Applies to TEC Pro 3.2. Notes: recently, while updating a client's website to the 3.2 plugin suite for Tribe's The Events Calendar I found that in the admin event list all the disappeared. After the normal, deactivating plugins, default theme etc I took the s…
<?php
/**
* update ~line 26 to include 2 argument params as such:
*/
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 );
/**
* update static function `events_search_orderby` (replace with the following method starting at ~line 159)
*/
@spivurno
spivurno / gw-field-info-tab.php
Created October 25, 2013 20:36
Gravity Wiz // Gravity Forms Field Info Tab
<?php
/**
* Gravity Forms Field Info Tab
* http://gravitywiz.com
*
* Adds a summary of your fields as a tab on the form settings screen; includes field ID, label and field type.
*
*/
class GWFieldInfo {
@hyle
hyle / ko.utils.3.0.0.signatures.js
Created October 25, 2013 13:08
KnockoutJS 3.0.0 utils (ko.utils) signatures
// knockout 3.0.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@olimortimer
olimortimer / gist:6775681
Created October 1, 2013 08:56
JS: Select2 FastClick Fix
$('#select2').select2({
data: data,
// Add our 'needsclick' to each item, so FastClick doesn't get applied
formatResult: function(result, container, query, escapeMarkup) {
container.addClass('needsclick');
return result.text;
}
});
@kloon
kloon / deploy.sh
Last active December 4, 2020 14:05
Github to WordPress.org plugin repo deploy
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="camptix-payfast-gateway"
CURRENTDIR=`pwd`
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config
@corsonr
corsonr / gist:6182904
Last active April 9, 2022 15:38
WooCommerce - Add custom fee to cart
<?php
/**
* WooCommerce Extra Feature
* --------------------------
*
* Add custom fee to cart automatically
*
*/
function woo_add_cart_fee() {
@corsonr
corsonr / gist:6154996
Created August 5, 2013 10:41
WooCommerce - Place "related products" within a tab
<?php
/*
* Place this code in functions.php in the theme folder
*/
/*
* Remove related products from product page
*/
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);