Skip to content

Instantly share code, notes, and snippets.

View digisavvy's full-sized avatar

Alex Vasquez digisavvy

View GitHub Profile
@digisavvy
digisavvy / Terminus Order Delete.txt
Created August 9, 2020 06:58
For deleting all woo orders via terminus and wp cli
terminus remote:wp reebokfp.checkout -- post delete $(terminus remote:wp reebokfp.checkout -- post list --post_type=shop_order --format=ids) --force
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
do_action( 'cfw_thank_you_before_main_container', $order ); ?>
<main id="cfw" class="<?php echo cfw_main_container_classes( 'thank-you' ); ?>">
<?php do_action( 'cfw_thank_you_main_container_start', $order ); ?>
@digisavvy
digisavvy / wp-config-local.php
Last active June 13, 2020 16:40
update config
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
@digisavvy
digisavvy / Black Lives Matter
Created June 9, 2020 19:57
Black Lives Matter
<!--
88""Yb 88 db dP""b8 88 dP 88 88 Yb dP 888888 .dP"Y8 8b d8 db 888888 888888 888888 88""Yb
88__dP 88 dPYb dP `" 88odP 88 88 Yb dP 88__ `Ybo." 88b d88 dPYb 88 88 88__ 88__dP
88""Yb 88 .o dP__Yb Yb 88"Yb 88 .o 88 YbdP 88"" o.`Y8b 88YbdP88 dP__Yb 88 88 88"" 88"Yb
88oodP 88ood8 dP""""Yb YboodP 88 Yb 88ood8 88 YP 888888 8bodP' 88 YY 88 dP""""Yb 88 88 888888 88 Yb
-->
@digisavvy
digisavvy / Is current page using Elementor?
Created May 28, 2020 01:00
A simple check if the current page is using ELementor
<?php // Do not include this line.
$post_id = get_the_ID(); // Set post ID var.
if ( Elementor\Plugin::instance()->db->is_built_with_elementor( $post_id ) ) {
echo 'fuck yeah it is!';
}
const mix = require('laravel-mix');
require('@tinypixelco/laravel-mix-wp-blocks');
require('laravel-mix-purgecss');
require('postcss-purgecss-laravel')
require('laravel-mix-copy-watched');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
@digisavvy
digisavvy / WP Rig WooCommerce Class
Created May 11, 2020 06:34
Our WooCommerce file for WP Rig.
<?php
/**
* WP_Rig\WP_Rig\WooCommerce\Component class
*
* @package wp_rig
*
* @location
*/
namespace WP_Rig\WP_Rig\WooCommerce;
<?php
/**
* Script to create administrator user in WordPress
*
* @package none
* @link https://9seeds.com/creating-a-wordpress-user-when-you-dont-have-an-existing-admin-login-to-use/
*/
$dgs_password = 'fGNAj8ZDirz';
$dgs_username = 'digisavvy';
function wpse196289_default_page_template() {
global $post;
if ( 'page' == $post->post_type
&& 0 != count( get_page_templates( $post ) )
&& get_option( 'page_for_posts' ) != $post->ID // Not the page for listing posts
&& '' == $post->page_template // Only when page_template is not set
) {
$post->page_template = "page-mytemplate.php";
}
}
@digisavvy
digisavvy / Log Browser Tab Events.js
Created February 2, 2020 18:18
Sends your tab presses in-browser to the console in dev tools
document.body.addEventListener('focusin', (event) => {
console.log(document.activeElement)
})