Skip to content

Instantly share code, notes, and snippets.

View webaware's full-sized avatar

Ross McKay webaware

View GitHub Profile
@webaware
webaware / ssl-remove-menu-link.php
Last active August 29, 2015 13:55
SSL Insecure Content Fixer plugin for WordPress add a Tools menu link to a simple test script. This micro-plugin removes that link!
@webaware
webaware / events-manager-custom-thumbnails.php
Created February 3, 2014 22:03
Example of using custom thumbnails for Events Manager plugin for WordPress.
<?php
/*
Plugin Name: Events Manager custom thumbnails
Plugin URI: https://gist.github.com/webaware/8793362
Description: example of using custom thumbnails for events
Version: 1
Author: WebAware
Author URI: http://www.webaware.com.au/
@ref: http://snippets.webaware.com.au/snippets/stop-events-manager-from-cropping-thumbnails/
@webaware
webaware / flxmap-kml-cache-buster.php
Last active August 29, 2015 13:56
WP Flexible Map plugin addon to force Google to reload KML maps every hour. NB: this solution won't work with page caching plugins, e.g. WP Super Cache / W3 Total Cache. The next version of WP Flexible Map will have a better solution that will work with caching plugins
<?php
/*
Plugin Name: Flxmap KML cache buster
Plugin URI: https://gist.github.com/webaware/8946050
Description: force Google to reload KML maps every hour
Version: 1
Author: WebAware
Author URI: http://webaware.com.au/
NB: this solution won't work with page caching plugins, e.g. WP Super Cache / W3 Total Cache
@webaware
webaware / flxmap-custom-address.php
Created April 2, 2014 04:33
Set map address from custom field "Street Address" if page/post has one, on Flexible Map plugin for WordPress
<?php
/*
Plugin Name: Flxmap Custom Address
Plugin URI: https://gist.github.com/webaware/9927981
Description: Set map address from custom field "Street Address" if page/post has one
Version: 1
Author: WebAware
Author URI: http://webaware.com.au/
@ref http://wordpress.org/support/topic/flexiblemap-address-using-data-from-custom-field
@webaware
webaware / 1000.csv
Created April 7, 2014 02:00
Copy a template WordPress post and duplicate it many times, to create some data for capacity testing. DON'T JUST RUN THE SCRIPT! First, create a post that will be your template, then get its post ID to use with the scripts below. Blog post to follow "one day"...
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1
2
3
4
5
6
7
8
9
10
@webaware
webaware / gfeway-only-months.php
Created April 13, 2014 04:35
only allow Monthly for recurring payments for Gravity Forms eWAY plugin
<?php
/*
Plugin Name: GFeWAY Recurring Monthly
Plugin URI: https://gist.github.com/webaware/10569363
Description: only allow Monthly for recurring payments
Version: 1
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/how-to-make-interval-type-have-monthly-option-only
@webaware
webaware / flxmap-jquery-activate.php
Last active August 29, 2015 14:01
When you hide a Flexible Map in a tab or accordion, and then click on the tab to reveal its contents, the map doesn't know how big to draw until it is revealed. You need to give Google Maps a nudge so that it will pick up the correct size and position when you reveal it.
<?php
/*
Plugin Name: Flxmap jQuery UI Activate
Plugin URI: https://gist.github.com/webaware/05b27e3a99ccb00200f5
Description: Fix maps in jQuery UI hidden accordion and tab panels
Version: 2
Author: WebAware
Author URI: http://www.webaware.com.au/
*/
@webaware
webaware / order-form-woo-attrs.php
Last active August 29, 2015 14:07
Add product attributes underneath the product title on an order form from Order Form for WooCommerce. Requires version 1.0.5 or higher. Save this file as a simple plugin in the WordPress plugins folder. http://orderform-woo.webaware.net.au/
<?php
/*
Plugin Name: Order Form for WooCommerce Product Attributes
Plugin URI: https://gist.github.com/webaware/931c8c216a90a16b9c62
Description: add product attributes to Order Form for WooCommerce product
Author: WebAware
Author URI: http://webaware.com.au/
*/
if (!defined('ABSPATH')) {
@webaware
webaware / gist:5d1dc611437dc60f25fb
Last active August 29, 2015 14:10
Add product description underneath the product title on an order form from Order Form for WooCommerce. Requires version 1.0.5 or higher. http://orderform-woo.webaware.net.au/
<?php
/**
* add product description to Order Form for WooCommerce product
* @param WC_Product $product
* @param array $attrs
*/
add_action('orderform_woocommerce_order_item_end', function($product, $attrs) {
$description = $product->get_post_data()->post_content;
@webaware
webaware / gist:fbaf2227f551900d4509
Created December 22, 2014 01:51
Make sure that Gravity Forms PDF has a chance to run when Gravity Forms DPS PxPay processes transaction returns and confirmations
<?php
/**
* Include the Gravity Forms PDF Extended class if the GFDPSPXPAY plugin is listening to a return URL (IPN-style)
*/
function pdf_init_gfdpspxpay() {
if (class_exists('GFPDF_Core') && empty($GLOBALS['gfpdf'])) {
global $gfpdf;
$gfpdf = new GFPDF_Core();
}