Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🐺
#LoneWolfLifestyle

Robert DeVore robertdevore

🐺
#LoneWolfLifestyle
View GitHub Profile
@robertdevore
robertdevore / wait-el.js
Created July 10, 2020 14:35 — forked from chrisjhoughton/wait-el.js
Wait for an element to exist on the page with jQuery
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
@robertdevore
robertdevore / woocommerce-custom-shipping-method.php
Created March 3, 2019 18:46 — forked from malkafly/woocommerce-custom-shipping-method.php
Adding custom shipping method for WooCommerce (v. 3.2.6)
<?php
//Works with WooCommerce 3.2.6
add_action( 'woocommerce_shipping_init', 'econt_shipping_method' );
function econt_shipping_method() {
if ( ! class_exists( 'WC_Econt_Shipping_Method' ) ) {
class WC_Econt_Shipping_Method extends WC_Shipping_Method {
public function __construct( $instance_id = 0 ) {
$this->instance_id = absint( $instance_id );
$this->id = 'econt';//this is the id of our shipping method
<?php
add_filter( 'fg_easypassthrough_populate_same_form', '__return_false' );
/**
* Custom account fields
*/
add_action( 'woocommerce_edit_account_form', 'my_woocommerce_edit_account_form' );
add_action( 'woocommerce_save_account_details', 'my_woocommerce_save_account_details' );
function my_woocommerce_edit_account_form() {
$user_id = get_current_user_id();
@robertdevore
robertdevore / post-process.php
Created August 10, 2018 14:31 — forked from bueltge/post-process.php
WordPress Custom Post Type: Insert post via Frontend
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']
@robertdevore
robertdevore / pmpro-limit-available-plugins-and-themes.php
Created May 17, 2018 00:03 — forked from strangerstudios/pmpro-limit-available-plugins-and-themes.php
Limit the available plugins and themes for networks sites in a WordPress multisite install using Paid Memberships Pro.
<?php
/*
Plugin Name: PMPro Limit Available Plugins and Themes
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-limit-available-plugins/
Description: Limits Which Plugins are Available for Network Sites
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
1. Place this file in wp-content/mu-plugins.
@robertdevore
robertdevore / install-google-fonts.sh
Created April 24, 2018 16:02 — forked from keeferrourke/install-google-fonts.sh
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell, ttf-ubuntu-font-family, git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
@robertdevore
robertdevore / upgrade_php_5-5_7-1_ubuntu.md
Created April 24, 2018 15:07 — forked from zuhairkareem/upgrade_php_5-5_7-1_ubuntu.md
Upgrading php 5.5.9 to php 7.1 in Ubuntu 14.04 LTS

Add the PPA

sudo add-apt-repository ppa:ondrej/php

Update repos

sudo apt-get update