Skip to content

Instantly share code, notes, and snippets.

View jaredkc's full-sized avatar

Jared Cornwall jaredkc

View GitHub Profile
@alexkingorg
alexkingorg / wp-social-comment-form-order.php
Created August 18, 2011 23:00
Have comments appear before comment form in Social
<?php
function akv3_social_comment_block_order($order) {
return array('comments', 'form');
}
add_filter('social_comment_block_order', 'akv3_social_comment_block_order');
@billerickson
billerickson / gist:1243276
Created September 26, 2011 20:13
Include In Rotator option in Media Uploader
<?php
/**
* Add "Include in Rotator" option to media uploader
* Limited to Home page
*
* @param $form_fields array, fields to include in attachment form
* @param $post object, attachment record in database
* @return $form_fields, modified form fields
@verticalgrain
verticalgrain / wp-geocode-postalcode-gravityforms.php
Last active September 4, 2017 17:55
Wordpress filter - Geocode postal code custom field to latitude and longitude custom fields - Gravity forms, regular custom fields
<?php
/**
* Geocodes a postal code field from a gravity form, saves latitude and longitude to custom fields
* To use this, change $entry[26] to the id of your gravity form field that contains the postal code - i.e. $entry[2]
* To use this, change the name of the geo_latitude and geo_longitude custom fields to what you've created.
* For bonus points, name your lat and long custom fields geo_latitude and geo_longitude, to be in line with Wordpress standard Geodata: https://codex.wordpress.org/Geodata
*
*
*/
@jaredkc
jaredkc / git-cheat-sheet.md
Last active September 25, 2017 17:03
GIT Cheat Sheet

Git Cheat Sheet

Branches

Delete remote branch: git push origin :<branchName>

Add a remote branch: git remote add <remoteName> <gitAddress>

@mukundthanki
mukundthanki / My Magento Code.php
Last active May 31, 2018 09:24 — forked from claudiu-marginean/My Magento Code.php
Magento: Code Snippets
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@LiamBailey
LiamBailey / Woocommerce Bookings Dropdown
Created March 10, 2016 18:25
Changes out the Woocommerce Bookings date picker fields for a nice dropdown showing only available dates
<?php
/*
Plugin Name: Woocommerce Bookings Dropdown
Description: Swaps the date picker for a dropdown of dates
Version: 1.0.0
Author: Webby Scots
Author URI: http://webbyscots.com/
*/
$wswp_dates_built = false;
add_filter('booking_form_fields','wswp_booking_form_fields');
@pmgarman
pmgarman / delete.sql
Created August 1, 2013 22:35
How to find and delete orphaned product variations from WooCommerce sites.
DELETE o FROM `wp_posts` o
LEFT OUTER JOIN `wp_posts` r
ON o.post_parent = r.ID
WHERE r.id IS null AND o.post_type = 'product_variation'
@kellyvaughn
kellyvaughn / graphql-using-vanilla-js.js
Last active January 11, 2022 23:12
Shopify GraphQL Storefront API using Vanilla JavaScript
// This example was used to pull in variant titles and IDs dynamically
// on a custom build of the ReCharge customer portal.
//
// Feel free to send me an email if you have any questions.
//
// Kelly Vaughn -- The Taproom Agency
// kelly@thetaproom.com
// 1. Retrieve product ID in any format
const productId = <pathToProductId>;
@mfields
mfields / theme-options.php
Created January 31, 2013 01:12
Sample theme options page for WordPress Themes.
<?php
/**
* _s Theme Options
*
* @package _s
* @since _s 1.0
*/
/**
* Register the form setting for our _s_options array.