First create global variables (in functions.php or as a mu-plugin):
<?php
/*
* CUSTOM GLOBAL VARIABLES
*/
function wtnerd_global_vars() {
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging | |
/** | |
* A modified (improved?) version of the jQuery plugin design pattern | |
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details. | |
* | |
* ADVANTAGES OF EITHER FRAMEWORK: | |
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace | |
* - Ensures ability to use '$' even in compat modes | |
* |
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
First create global variables (in functions.php or as a mu-plugin):
<?php
/*
* CUSTOM GLOBAL VARIABLES
*/
function wtnerd_global_vars() {
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
// =================================================== | |
// Font Face Rules | |
// =================================================== | |
@font-face { | |
font-family: 'Clear Sans'; | |
font-style: normal; | |
font-weight: 100; | |
src: local('ClearSans-Thin'), local('Clear Sans Thin'), | |
url('../fonts/clearsans/ClearSans-Thin.eot'), |
/** | |
* Filter Gravity Forms select field display to wrap optgroups where defined | |
* USE: | |
* set the value of the select option to `optgroup` within the form editor. The | |
* filter will then automagically wrap the options following until the start of | |
* the next option group | |
*/ | |
add_filter( 'gform_field_content', 'filter_gf_select_optgroup', 10, 2 ); | |
function filter_gf_select_optgroup( $input, $field ) { |
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'json' | |
require 'csv' | |
infile = ARGV[0] | |
json = File.read(infile) | |
parsed = JSON.parse(json.encode("UTF-8")) | |
outfile = ARGV[1] |
<script type="text/javascript"> | |
/* in order to update info on your checkout page you need to trigger update_checkout function | |
so add this in your javascript file for your theme or plugin | |
*/ | |
jQuery('body').trigger('update_checkout'); | |
/* what this does is update the order review table but what it doesn't do is update shipping costs; | |
the calculate_shipping function of your shipping class will not be called again; | |
so if you were like me and you made a shipping method plugin and you had to change costs based on payment method then |
;(function($) { | |
var JA_Custom_Validation = { | |
/** | |
* Start the engine. | |
* | |
* @since 1.0.0 | |
*/ | |
init: function() { |