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
// example of JavaScript for somewhere on the page | |
<script> | |
function myReloadCart() { | |
form_values = "ajax=true&my_plugin_no_force_load=1" | |
jQuery.post( 'index.php?wpsc_ajax_action=get_cart', form_values, function(returned_data) { | |
eval(returned_data); | |
}); | |
} | |
</script> |
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 | |
/* | |
In reply to this request: | |
http://wordpress.org/support/topic/plugin-wp-flexible-map-updating-the-map-from-custom-field-data | |
add a simple [map] shortcode to WordPress that allows maps to be | |
created from custom fields: | |
"map zoom" = the zoom level (will default to 12 if not set) |
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 | |
/* | |
-- the SQL database table | |
create table form_ajax ( | |
ID varchar(5) not null, | |
Name varchar(100), | |
Address varchar(100), | |
Phone varchar(20), | |
Email varchar(255), |
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 | |
function filterSitemapOptions($opts) { | |
global $wpdb; | |
// tell it to exclude any pages that are just page-links-to links to PDF files | |
$exclude = $wpdb->get_col("select post_id from $wpdb->postmeta where meta_key = '_links_to' and meta_value like '%.pdf'"); | |
if (!empty($exclude)) { | |
$opts['sm_b_exclude'] = array_merge($opts['sm_b_exclude'], $exclude); | |
} |
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 | |
/** | |
* filter the eWAY invoice description for a Gravity Form post | |
* @param string $desc the description before filtering | |
* @param array $form the Gravity Form object | |
* @return string | |
*/ | |
function my_gfeway_invoice_desc($desc, $form) { | |
// set by form ID | |
switch ($form['id']) { |
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
<?php | |
// jQuery version of https://gist.github.com/3110728 | |
/* | |
-- the SQL database table | |
create table form_ajax ( | |
ID varchar(5) not null, | |
Name varchar(100), | |
Address varchar(100), |
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) { |
OlderNewer