Skip to content

Instantly share code, notes, and snippets.

View BurlesonBrad's full-sized avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
@BurlesonBrad
BurlesonBrad / Sensei Points
Last active October 10, 2015 19:17
Attempt to connect Completing a Sensei LESSON to points and rewards
<?php
// THIS IS THE FILE FROM https://gist.github.com/woogist/5692886#file-gistfile1-php//
// ...and, believe it or not, I understand about 50% of this.//
// While that's better than the average Joe, it' still not enough to actually CONNECT the points //
// Anyone want to jump in here? //
// Add the action setting
add_filter( 'wc_points_rewards_action_settings', 'bkg_sensei_points' );
function points_rewards_newsletter_action_settings( $settings ) {
@BurlesonBrad
BurlesonBrad / Two Emails for Low Stock
Created August 30, 2015 02:37
Two Emails for Low Stock
<?php
function woo_extra_email_recipient($recipient, $object) {
$recipient = $recipient . ', [email protected]';
return $recipient;
}
add_filter( 'woocommerce_low_stock', 'woo_extra_email_recipient', 10, 2);
// Custom CSS to change Variation Dropdown //
.woocommerce div.product form.cart .variations select {
width: 190px;
float: left;
background: -webkit-linear-gradient(top, rgb(255, 255, 255) 0%,rgb(194, 204, 228) 100%);
border-radius: 5px;
border: 1px solid rgba(0,0,0,0.3);
box-shadow: 0 0 5px 1px rgba(0,0,0,0.2), inset 0 1px 0 0px rgba(255,255,255,0.3);
margin: 50px;
}
@BurlesonBrad
BurlesonBrad / functions.php
Last active October 16, 2016 22:34
Yvan's functions.php file for the child theme
<?php
/**
* Yvan's child theme functions.php file. You can "move" this child function.php into ANY (<---pretty cool, right?) child theme that you want.
*
* @package storefront-child
*/
// DO NOT REMOVE THIS FUNCTION AS IT LOADS THE PARENT THEME STYLESHEET
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
@BurlesonBrad
BurlesonBrad / Here 'ya go
Created July 16, 2015 18:08
For WarFarePlugins
/**
* Redirect user to checkout page directly after adding to cart
*
* @return string
*/
function wc_redirect_to_checkout() {
$checkout_url = WC()->cart->get_checkout_url();
return $checkout_url;
}
@BurlesonBrad
BurlesonBrad / DNS Prefetching
Created July 15, 2015 21:47
DNS Prefetching
/*
* Let's see if I can do dns prefetching correctly
*/
add_action('wp_head', 'dns_prefetch');
function dns_prefetch() {
echo '<link rel="dns-prefetch" href="//fonts.gstatic.com" />';
echo '<link rel="dns-prefetch" href="//google-analytics.com" />';
echo '<link rel="dns-prefetch" href="//google.com" />';
echo '<link rel="dns-prefetch" href="//stats.g.doubleclick.net" />';
function woo_custom_wp_mail_from() {
global $woocommerce;
return html_entity_decode( '[email protected]' );
}
add_filter( 'wp_mail_from', 'woo_custom_wp_mail_from', 99 );
@BurlesonBrad
BurlesonBrad / Manja
Created July 7, 2015 22:07
For Manja
// Our hooked in function - $fields is passed via the filter!
function dropdown( $fields ) {
$fields['billing']['dropdown'] = array(
'label' => __('Howdy Manja. Would You Like Your Order Gift Wrapped for Free?', 'woocommerce'),
'placeholder' => _x('dropdown', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true,
'type' => 'select',
'options' => array(
@BurlesonBrad
BurlesonBrad / Line 374 of wc-template-functions.php
Created May 28, 2015 15:59
Add html to WooCommerce Storewide Notice
echo apply_filters( 'woocommerce_demo_store', '<p class="demo_store">' . '<a href ="https://www.facebook.com/groups/advanced.woocommerce/permalink/1087929507888134/">' . $notice .'</a>' . '</p>' );
@BurlesonBrad
BurlesonBrad / Border Control
Created May 27, 2015 18:49
Block Everything But the United States
This file has been truncated, but you can view the full file.
# BLOCK COUNTRY BY IP RANGE
# IncrediBILL's HTACCESS Tools
# http://incredibill.me
<Limit GET POST HEAD>
order allow,deny
#
# Block from AFGHANISTAN (AF)
#
deny from 27.116.56.0/22
deny from 43.231.131.0/24