Skip to content

Instantly share code, notes, and snippets.

JayWood

Block or report user

Report or block JayWood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JayWood
JayWood / phpstorm-livetemplate-wpcli-scaffold.txt
Created Jun 21, 2019
A live template for PHPStorm to create WP-CLI commands on-the-fly.
View phpstorm-livetemplate-wpcli-scaffold.txt
namespace $var1$;
use Exception;
use WP_CLI;
class $class$ {
/**
* The WP-CLI Command Arguments
*
* Nothing to see here.
View register-all-taxes.php
<?php
/**
* Include all non-core taxonomies in the sync request, limiting by publicly queryable.
*
* @param array The list of existing taxonomies.
* @return array The new array list.
*/
function sync_non_core_taxonomies( $taxonomies ) {
$taxes = get_taxonomies();
foreach ( $taxes as $taxonomy ) {
@JayWood
JayWood / default.conf
Created Jan 13, 2019
Don't want to download your uploads from the remote, me either...
View default.conf
# Directives to send expires headers and turn off 404 error logging.
location ~* .(js|css|png|jpg|jpeg|gif|ico|mp3|mov|tif|tiff|swf|txt|html)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
# replace www.livesite.com with the production site URL
View exclude-list.txt
/vendor/
.gitignore
composer.*
readme.md
/.git/
uploads/
upgrade/
*node_modules*
*.gitignore
*.gitmodules
View jw-shortcode-scraper.php
<?php
namespace JW\CLI;
use WP_CLI;
use WP_CLI_Command;
/**
* A shortcode scraper class.
*/
@JayWood
JayWood / shortcode-scraper.php
Created Sep 10, 2018
A tool to provide reports for short-codes created.
View shortcode-scraper.php
<?php
namespace JW\CLI;
use WP_CLI;
use WP_CLI_Command;
/**
* A shortcode scraper class.
*/
@JayWood
JayWood / resource-pool
Created Jul 15, 2017
Resource Pool Template
View resource-pool
# This sets up a resource pool for the user.
# By setting up a resource pool you are basically separating server reources between users.
# Author: Jay Wood
# http://github.com/JayWood
[%USER%]
prefix = /home/$pool
user = %USER%
@JayWood
JayWood / class-admin.php
Created Nov 28, 2016
My Custom Settings API Implementation for those of us who don't need bloated options panel libraries.
View class-admin.php
<?php
/**
* WooCommerce Order Generator Admin Options Page
*
* @since NEXT
* @package WooCommerce Order Generator
*/
/**
* WooCommerce Order Generator Admin.
@JayWood
JayWood / finding-registered-post-types.php
Created Nov 23, 2016
Finds registered post types from their originating location using debug_backtrace()
View finding-registered-post-types.php
function my_registered_type( $post_type ) {
if ( 'shop_order' !== $post_type ) {
return;
}
$backtrace = debug_backtrace();
$iterator = count( $backtrace ) - 1;
if ( $iterator <= 0 ) {
return;
@JayWood
JayWood / jays-fix-serialization.php
Last active Mar 25, 2017
This script was inspired by the script from Blogestudio located at https://github.com/Blogestudio/Fix-Serialization. For yearsI used this script to fix serialization, however, just recently I needed to fix a 1GB+ file and the methods in use on the original script was not ideal for reading a large file.Therefore this script was built.
View jays-fix-serialization.php
<?php
/**
* Jays Fix Serialization
*
* Fixes serialization in SQL files after replacements are done.
* License: GPL version 3 or later - http://www.gnu.org/licenses/gpl.txt
* By: Jay Wood ( jjwood2004@gmail.com )
* http://plugish.com
*
* Usage:
You can’t perform that action at this time.