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 / woocommerce-overrides.php
Created March 10, 2016 21:34 — forked from TimBHowe/woocommerce-variation-grid-add-cart.php
Include this in your theme to allow WooCommerce variable products to be displayed in a grid format with each variation having there own quantity and add to cart button, rather then the drop-down options. This should be include in your themes function file.
<?php
/******************************************************************************
* Variation Grid
*
* The following function allow for the theme to display product variations in a grid format.
* This code could be moved to a plugin but is in the theme function file as it used the
* themes grid system.
*
* @reference: http://www.eggplantstudios.ca/woocommerce-product-variation-add-cart-grid/
* ******************************************************************************/
@BurlesonBrad
BurlesonBrad / functions.php
Created March 10, 2016 21:34 — forked from TimBHowe/functions.php
Reduce or remove WooCommerce 2.5 minimum password strength requirement for creating a user account. Warning: Use at your own risk.
<?php
/**
*Reduce the strength requirement on the woocommerce password.
*
* Strength Settings
* 3 = Strong (default)
* 2 = Medium
* 1 = Weak
* 0 = Very Weak / Anything
*/
@BurlesonBrad
BurlesonBrad / prev-next-same-category.php
Created March 7, 2016 23:59
Christopher Roy's Plugin
<?php
/**
* Plugin Name: Christopher's Plugin
* Description: Pucker, Pray, and hope that I didn't miss anything. Should make prev & next stay within the same category! *SHOULD* ;-)
* Version: 1.0.0
* Author: Brad Griffin
* Author URI: https://bradgriffin.me
*/
/** Christopher: Download this file, then upload it via FTP into your /plugins folder.
@BurlesonBrad
BurlesonBrad / toggle-admin-ajax.php
Last active February 27, 2016 23:33
Phil Kills off Admin Ajax via a Plugin
<?php
/**
* Plugin Name: Phil Kills of Admin Ajax via a Plugin
* Plugin URI: https://yourmom.com
* Description: A Drop In Plugin That'll kill off admin-ajax.php. No options, just ACTIVE or INCACTIVE :-)
* Version: 1
* Author: Brad
* Author URI: https://yourmom.com
* Requires at least: 4.5
* Tested up to: 4.5
@BurlesonBrad
BurlesonBrad / dropzonejs-wp-rest-api.js
Created January 29, 2016 03:21 — forked from soderlind/dropzonejs-wp-rest-api.js
DropzoneJS & WordPress REST API
/*
Uploading images is a two step process (from https://github.com/WP-API/WP-API/issues/1768#issuecomment-160540932):
POST the data to /wp/v2/media - this can either be as the request body, or in multipart format. This will upload the file, and give you a 201 Created response with a Location header. This header points to the post object for the attachment that has just been created.
PUT the post data to the endpoint returned in the Location header (which will look something like /wp/v2/media/{id}).
I do step 2 (PUT), if POST is a success, in myDropzone.on("success", function(file, response){}
*/
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute
/** Robin, you can add these lines to your child theme's functions.php file
* If you're NOT using a child theme, please copy / paste this link
* https://github.com/woothemes/theme-customisations/archive/master.zip
* and use that plugin to make custimizations like this one to your theme
* Best wishes Robin
**/
add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout');
function woo_redirect_to_checkout() {
$checkout_url = WC()->cart->get_checkout_url();
@BurlesonBrad
BurlesonBrad / errorlog
Last active January 21, 2016 18:03
jason
[14-Jan-2016 20:47:29 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to Prompt_Wp_Mailer::__construct() must be an instance of Prompt_Interface_Http_Client, instance of Prompt_Comment_Email_Batch given, called in /home/bradgrif/public_html/wp-content/plugins/postmatic/core/mailers/comment-wp-mailer.php on line 25 and defined in /home/bradgrif/public_html/wp-content/plugins/postmatic/core/wp-mailer.php:10
Stack trace:
#0 /home/bradgrif/public_html/wp-content/plugins/postmatic/core/mailers/comment-wp-mailer.php(25): Prompt_Wp_Mailer->__construct(Object(Prompt_Comment_Email_Batch), NULL, NULL, 0)
#1 /home/bradgrif/public_html/wp-content/plugins/postmatic/core/factory.php(92): Prompt_Comment_Wp_Mailer->__construct(Object(Prompt_Comment_Email_Batch))
#2 /home/bradgrif/public_html/wp-content/plugins/postmatic/core/factory.php(26): Prompt_Factory::make_local_mailer(Object(Prompt_Comment_Email_Batch), '')
#3 /home/bradgrif/public_html/wp-content/plugins/postmatic/core/comment-mailing.php(26): Prompt_Fac
@BurlesonBrad
BurlesonBrad / .htaccess
Last active January 14, 2016 19:22
For Jason: stop traffic to the mirror from accessing the site?
# Jason: First, open this image --> http://i.imgur.com/i7METNn.png #
# Now, assuming that there is already an .htaccess file in place, simply add the code below to that file #
AuthUserFile .htpasswd
AuthName "Staged Login Area"
AuthType Basic
require user dave
@BurlesonBrad
BurlesonBrad / text-changes.php
Last active January 14, 2016 14:36
For Nikki ~ Change Text in WooCommerce
<?php
/**
* Plugin Name: Nikki Gets to Change Her Text
* Plugin URI: https://bradgriffin.me
* Description:
* Version: 1
* Author: Brad
* Author URI: https://bradgriffin.me
* Requires at least: 4.5
* Tested up to: 4.5
@BurlesonBrad
BurlesonBrad / jonathans-speed.php
Last active January 6, 2016 05:42
for Jonathan
<?php
/**
* Plugin Name: Jonathan's Speed Plugin
* Plugin URI: https://bradgriffin.me
* Description:
* Version: 1
* Author: Brad
* Author URI: https://bradgriffin.me
* Requires at least: 4.5
* Tested up to: 4.5