This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// drop this code into your theme's functions.php file and edit the array properties below | |
add_action('widgets_init', 'widgetsInitExampleMap'); | |
function widgetsInitExampleMap() { | |
register_widget('ExampleMapWidget'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// code from blog post: | |
// http://snippets.webaware.com.au/snippets/make-css-drop-down-menus-work-on-touch-devices/ | |
// this version: 27 November, 2012 | |
// "an attempt to make it work on Windows 8 -- please try and tell me" | |
// see whether device supports touch events (a bit simplistic, but...) | |
var hasTouch = ("ontouchstart" in window || ("msMaxTouchPoints" in navigator && navigator.msMaxTouchPoints > 0)); | |
var iOS5 = /iPad|iPod|iPhone/.test(navigator.platform) && "matchMedia" in window; | |
// hook touch events for drop-down menus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* I don't like this sort of thing, but I have a client who needs it. | |
* What I did for them was to put the email address on the page encoded in base64, | |
* and use client-side script to decode it. | |
*/ | |
// server-side... | |
/** | |
* return HTML for a base64-encoded email link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('gfeway_invoice_ref', 'my_gfeway_invoice_ref', 10, 2); | |
/** | |
* filter the eWAY invoice reference for a Gravity Form post | |
* @param string $ref the reference before filtering | |
* @param array $form the Gravity Form object | |
* @return string | |
*/ | |
function my_gfeway_invoice_ref($ref, $form) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* extend WP e-Commerce customer emails to add shipping and billing details | |
* drop this into a plugin, or add to your theme's functions.php | |
*/ | |
class WpscExtendCustEmail { | |
/** | |
* add filter hooks | |
*/ | |
public function __construct() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* replace icons in Social Media Feather with custom icons | |
* @ref: http://wordpress.org/plugins/social-media-feather/ | |
*/ | |
add_filter('synved_social_skin_image_list', 'custom_social_feather_icons'); | |
function custom_social_feather_icons($image_list) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_print_footer_scripts', function() { | |
?> | |
<script> | |
(function() { | |
var p = document.createElement("p"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Flxmap Valter KML map | |
Description: Valter wants to centre/zoom KML maps | |
Version: 1 | |
Author: WebAware | |
Author URI: http://wordpress.org/support/topic/testing-sometimes-it-does-not-work?replies=5#post-5040741 | |
*/ | |
add_action('wp_enqueue_scripts', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Gravity Forms Aussie Addresses | |
Plugin URI: https://gist.github.com/webaware/f445808d0475ea0e02f2 | |
Description: Australian address fields in Gravity Forms | |
Author: thewebprincess | |
Author URI: https://thewebprincess.com/ | |
Version: 0.0.1 | |
@link https://gist.github.com/thewebprincess/7855509 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* append hash to referrer URI | |
* @param array $attrs | |
*/ | |
add_action('orderform_woocommerce_form_before', function($attrs) { | |
// remove any existing hash | |
$_SERVER['REQUEST_URI'] = preg_replace('/#.*$/', '', $_SERVER['REQUEST_URI']); |