Skip to content

Instantly share code, notes, and snippets.

View leepeterson's full-sized avatar
:octocat:

Lee Peterson leepeterson

:octocat:
View GitHub Profile
@leepeterson
leepeterson / .gitignore
Last active October 7, 2016 19:55 — forked from salcode/.gitignore
General WordPress .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@leepeterson
leepeterson / acf-disable-frontend.php
Last active September 17, 2020 07:27 — forked from billerickson/be-disable-acf-frontend.php
Disable ACF functions on the front-end of WordPress in order to provide a performance boost.
<?php
/**
* Plugin Name: Disable ACF on Frontend
* Description: Disable ACF functions on the front-end of WordPress in order to provide a performance boost.
* Version: 2.0
* Author: Lee Peterson
* Author URI: http://www.leepeterson.me
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
@leepeterson
leepeterson / 0_reuse_code.js
Created February 4, 2017 01:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@leepeterson
leepeterson / gist:abfe768dbb222c19e3097a884969c8ac
Last active May 17, 2017 11:20 — forked from levelsio/gist:122907e95956602e5c09
slack2html: Export Slack chat history to HTML
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@leepeterson
leepeterson / wp_mail.md
Created August 5, 2017 19:41 — forked from johnbillion/wp_mail.md
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.8, and includes some upcoming changes in WordPress 4.9.

There are a few TODOs left. Please bear with me.

@leepeterson
leepeterson / plugin_debug.php
Created September 2, 2017 09:05 — forked from chasecmiller/plugin_debug.php
Proof of concept of a WordPress mu-plugin to automatically disable plugins that start throwing errors.
<?php
/*
Plugin Name: Plugin Debugging Tool
Description: Proof of concept of a WordPress mu-plugin to automatically disable plugins that start throwing errors. Must be installed as mu-plugin. The first time a plugin errors, it will white screen or show an error. Next page load, it is disabled. There has not been any functionality to remove plugins from the black list. If you'd like to see it developed more, please email chase@crumbls.com Only tested on Apache running PHP7.
Author: Chase C. Miller
Author Email: chase@crumbls.com
Version: 1.0
Author URI: http://crumbls.com
*/
@leepeterson
leepeterson / class-global-sniffer.php
Created September 5, 2017 02:15 — forked from Rarst/class-global-sniffer.php
Discover where is array global being modified, because WordPress.
<?php
namespace Rarst;
/**
* Discover where is array global being modified, because WordPress.
*/
class Global_Sniffer implements \ArrayAccess {
protected $name;
@leepeterson
leepeterson / rm-video-formats.md
Last active February 19, 2020 16:55 — forked from Vestride/encoding-video.md
Rawle Murdy's Web Video Requirements

Rawle Murdy's Web Video Requirements

As of July 2018:

  1. 4K WebM video encoded with VP9

2a. 1080p MP4 video encoded with HEVC/H.265

2b. Optional: 1080p MP4 encoded with MPEG-4/H.264 (if Windows Mobile and IE8-11 support is required)

@leepeterson
leepeterson / disable_dash.php
Created August 22, 2018 22:40 — forked from bryanwillis/disable_dash.php
Different ways to remove wp dashboard widgets. I think disable_dash.php is considered the best method.
//* REMOVE DASHBOARD WELCOME
remove_action('welcome_panel', 'wp_welcome_panel');
// */
//* REMOVE ADMIN DASHBOARD WIDGETS
// Create the function to use in the action hook
function remove_default_dashboard_widgets() {