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 | |
/** | |
* Implement 'wp_ajax_send-attachment-to-editor' to not attach an unattached media item. | |
* | |
* In WordPress TRAC 22085 there was a change. | |
* that caused unattached media files (images) to be attached to posts if they are inserted into the post. | |
* | |
* If you don't like this strategy you can disable it using this simple, rather hacky, action hook. | |
* |
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
if ( typeof yourFunctionName == 'function' ) { | |
yourFunctionName(); | |
} |
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 | |
/** | |
* WPSC Variation Group Name Display | |
* | |
* @param string $name Group name. | |
* @param WP_Term $group Group term object. | |
* @return string Group name. | |
*/ | |
function my_wpsc_vargrp_name( $name, $group ) { |
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
( function( $ ) { | |
$.fn.helloWorld = function( options ) { | |
// Establish our default settings | |
var settings = $.extend( { | |
text : 'Hello, World!', | |
color : null, | |
fontStyle : null, | |
complete : null |
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
/** | |
* 100% height div across multiple browsers including mobile Safari. | |
* http://www.ethanhackett.com/?blog=window-height-100-on-mobile-safari-coding-solution | |
*/ | |
( function( $, window, undefined ) { | |
// First check to see if the platform is an iPhone, iPod, iPad (mobile Safari) | |
if ( /iP/.test( navigator.platform ) && /Safari/i.test( navigator.userAgent ) ) { | |
var mobileSafari = "Safari"; | |
} |
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
# Redirect other IP addresses | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# Single IP Address | |
RewriteCond %{REMOTE_HOST} !^00.00.00.00 | |
# Multiple IP Addresses | |
RewriteCond %{REMOTE_HOST} !^(00.00.00.00|00.00.00.00) | |
RewriteRule .* http://www.example.com/ [R=301,L] |
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
{ | |
"url": "http://example.com/json", | |
"rates": [ | |
{ | |
"name": "Belgium", | |
"code": "BE", | |
"periods": [ | |
{ | |
"effective_from": "1996-01-01", | |
"rates": { |
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 | |
/** | |
* Customise WordPress Vimeo oEmbed | |
* https://developer.vimeo.com/apis/oembed | |
*/ | |
function my_oembed_fetch_url( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) !== false) { |
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
/** | |
* jQuery Wrapper | |
*/ | |
( function( $ ) { | |
// Safe to use $ | |
} )( jQuery ); |