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 / autocomplete-virtual-orders.php
Created January 24, 2019 17:09
Automatically Complete All Virtual Orders In WooCommerce
/**
* AutoComplete Virtual Orders
*/
function autocomplete_virtual_orders_in_woocommerce( $order_id ) {
// if there is no order id, then stop
if ( ! $order_id ) {
return;
}
@BurlesonBrad
BurlesonBrad / amiriqbalmcs.css
Last active December 16, 2018 19:46
link-effects
a.cl-effect-2{
-webkit-perspective:1000px;
-moz-perspective:1000px;
perspective:1000px;
color:#fff;
}
a.cl-effect-2 span{
position:relative;
display:inline-block;padding:0 14px;
function ap_user_can_read_comments( $_post = null, $user_id = false ) {
$_post = ap_get_post( $_post );
// Get current user if no user_id supplied
if ( false === $user_id ) {
$user_id = get_current_user_id();
}
// All support admins get the green light
if ( is_super_admin( $user_id ) ) {
@BurlesonBrad
BurlesonBrad / function-minify-html.php
Created October 3, 2018 19:23 — forked from anonymous/function-minify-html.php
Minify HTML function for Wordpress.
<?php
//=============================================================================================
// FUNCTION -> MINIFY HTML OUTPUT
//=============================================================================================
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
@BurlesonBrad
BurlesonBrad / automatically-complete-virtual-orders.php
Created September 4, 2018 23:09
If a WooCommerce Order has VIRTUAL checked, then simply AUTOCOMPLETE that order
/**
* Autocomplete orders with only virtual products.
* From the 2nd edition of Building Web Apps with WordPress
* https://bwawwp.org
*/
function autocomplete_virtual_orders($order_id) {
//get the existing order
$order = new WC_Order($order_id);
//assume we will autocomplete
// Additional Code from Brad. //
// Provides the ability to sort Component Option Filters by custom priority numbers. //
// Added to Child X Theme functions.php file //
add_action( 'woocommerce_composite_component_admin_config_filter_options', 'wc_cp_admin_filter_priorities', 10, 3 );
add_filter( 'woocommerce_composite_process_component_data', 'wc_cp_admin_process_filter_priorities', 10, 4 );
add_filter( 'woocommerce_composite_component_filters', 'wc_cp_sort_filters', 10, 3 );
function wc_cp_admin_filter_priorities( $id, $data, $product_id ) {
$filters_priority = isset( $data[ 'filters_priority' ] ) ? $data[ 'filters_priority' ] : '';
?>
@BurlesonBrad
BurlesonBrad / josh.txt
Created July 24, 2018 13:18
.htaccess
Redirect 301 https://saveonmagazines.com/this-is-your-old-url https://saveonmagazines.com/this-is-the-NEW-url
@BurlesonBrad
BurlesonBrad / gdpr-change.php
Last active June 11, 2018 21:41
Change GDPR text
function gdpr_uwphelp( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Save my name, email, and website in this browser for the next time I comment.' :
$translated_text = __( 'UltimateWPHelp can change the default text' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'gdpr_uwphelp', 20, 3 );
@BurlesonBrad
BurlesonBrad / notes.txt
Created June 3, 2018 18:54
secret gist notes for referencing
Subscription Notes:
04-20-2018 @ 10:13:18 - scheduled action 52816 (subscription payment) failed to finish processing after 300 seconds
04-20-2018 @ 10:13:18 - action args: subscription_id: 52814
04-22-2018 @ 20:03:38 - scheduled action 52851 (subscription payment) failed to finish processing after 300 seconds
04-22-2018 @ 20:03:38 - action args: subscription_id: 48221
04-26-2018 @ 19:03:26 - scheduled action 53609 (subscription payment) failed to finish processing after 300 seconds
04-26-2018 @ 19:03:26 - action args: subscription_id: 52391
04-26-2018 @ 22:05:28 - scheduled action 53801 (subscription payment) failed to finish processing after 300 seconds
04-26-2018 @ 22:05:28 - action args: subscription_id: 48312
@BurlesonBrad
BurlesonBrad / text-lifting-snippet.php
Last active December 16, 2018 12:16
Changing Text in LIfterLMS
<?php
/**
* Plugin Name: Lift The Text
* Plugin URI: https://yourmom.com
* Description: Engage Maverick | ENGAGE! Make a conversation with your customer and customize EVERY piece of Text!
* Version: 1
* Author: Brad
* Author URI: https://yourmom.com
* Requires at least: 4.9.6
* Tested up to: 5.0-alpha-43049