Skip to content

Instantly share code, notes, and snippets.

View BurlesonBrad's full-sized avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
`
### wp-core ###
version: 5.7.2
site_language: en_US
user_language: en_US
timezone: America/Chicago
permalink: /%postname%/
https_status: true
multisite: false
@BurlesonBrad
BurlesonBrad / local.log
Created March 23, 2021 02:12
local log
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\apache-2.4.43+6\\lib\\main.js","timestamp":"2021-03-20T19:11:24.995Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%\\lightning-services\\apache-2.4.43+6\\lib\\main.js","timestamp":"2021-03-20T19:11:25.332Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\php-7.4.1+14\\lib\\main.js","timestamp":"2021-03-20T19:11:25.338Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%\\lightning-services\\php-7.4.1+14\\lib\\main.js","timestamp":"2021-03-20T19:11:25.491Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\php-8.0.0+1\\lib\\main.js","timestamp":"2021-03-20T19:11:25.497Z"}
{"thread":"main","class":
@BurlesonBrad
BurlesonBrad / addme
Created January 5, 2021 21:32
add me
<IfModule mod_deflate.c>
# Force compression for mangled headers.
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
/** Disable Ajax Call from WooCommerce */
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11);
function dequeue_woocommerce_cart_fragments() {
if (is_front_page()) wp_dequeue_script('wc-cart-fragments');
}
@BurlesonBrad
BurlesonBrad / header-tracking-snippet.php
Created January 27, 2020 18:27
🚫No WordPress plugin needed to add tracking code to the header 👍
function header_tag_analytics() { ?>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-XX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXX-XX');
</script>
// Add your Tweeder scripts Adroll scripts Facebook scripts BounceX scripts Optimizely scripts or whatever needs to be in the head
@BurlesonBrad
BurlesonBrad / snippet.php
Created November 4, 2019 03:10
Jason changes the WooCommerce Checkout Custom Ajax Spinner
add_action('wp_head', 'custom_ajax_spinner', 1000 );
function custom_ajax_spinner() {
?>
<style>
.woocommerce .blockUI.blockOverlay:before,
.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
top: 50%;
@BurlesonBrad
BurlesonBrad / promise.php
Created October 29, 2019 18:39
/wp-content/plugins/google-site-kit/third-party/react/promise/src/
<?php
namespace Google\Site_Kit_Dependencies\React\Promise;
class Promise implements \Google\Site_Kit_Dependencies\React\Promise\ExtendedPromiseInterface, \Google\Site_Kit_Dependencies\React\Promise\CancellablePromiseInterface
{
private $canceller;
private $result;
private $handlers = [];
private $progressHandlers = [];
@BurlesonBrad
BurlesonBrad / .htaccess
Created October 23, 2019 11:40
Get *ALL* domain addresses pointed in the *RIGHT* direction 👍
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://domain.com%{REQUEST_URI} [L,NE,R=301]
@BurlesonBrad
BurlesonBrad / snippets.php
Created April 24, 2019 19:27
Miranda: Add these two snippets to the "Code Snippets" plugin.
function redirect_to_home_if_author_parameter() {
$is_author_set = get_query_var( 'author', '' );
if ( $is_author_set != '' && !is_admin()) {
wp_redirect( home_url(), 301 );
exit;
}
}
add_action( 'template_redirect', 'redirect_to_home_if_author_parameter' );
@BurlesonBrad
BurlesonBrad / suspend.php
Created March 19, 2019 20:57
for Amanda Brookshire
<?php /* <---don't add that line if you're pasting this into a snippets plugin */
add_filter( 'gettext', 'amanda_changes_suspend_to_pause', 20, 3 );
function amanda_changes_suspend_to_pause( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Suspend' :
$translated_text = __( 'Pause', 'woocommerce' );
break;
}
}