Skip to content

Instantly share code, notes, and snippets.

Working hard reviewing and deploying code

Scott Kingsley Clark sc0ttkclark

Working hard reviewing and deploying code
View GitHub Profile
sc0ttkclark / custom-pods-shortcode-total-text.php
Last active May 28, 2019
Custom `[pods]` shortcode handling for total text.
View custom-pods-shortcode-total-text.php
* Ensure total_found() gets calculated right away, because in the [pods] shortcode
* it does other queries after the initial find().
add_filter( 'pods_data_auto_calculate_total_found', '__return_true' );
* Add custom shortcode handling for total text.
djrmom / custom-hooks.php
Created Feb 8, 2018
facetwp index a field in a related post type
View custom-hooks.php
** look up and index a value from a post relationship field
** set the datasource to the relationship field
** get the post id of that related post and use it to
** lookup its associated value
** for ACF you may want get_field() instead of get_post_meta()
** remember to do a full re-index after adding code
** check the wp_facetwp_index table if needed to see what values are being indexed
jamesgol / CPT-Admin-Fields.php
Created Oct 25, 2016
Pods CPT Admin Fields
View CPT-Admin-Fields.php
* Name: CPT Admin Fields
* Description: Allow adding fields to the CPT editor table.
* Version: 2.3
* Category: Advanced
sc0ttkclark / userscript.js
Created Oct 7, 2016
Papertrail JSON formatter (with addStyle fix)
View userscript.js
// ==UserScript==
// @name Papertrail JSON formatter
// @namespace
// @version 0.1
// @description Format and colorize JSON log messages in Papertrail
// @match*events*
// @copyright 2014+, Papertrail (
// @grant GM_addStyle
// ==/UserScript==
sc0ttkclark / .htaccess
Last active May 3, 2016
Add these lines to your .htaccess file if you can't get cPanel Let's Encrypt installation or renewal working properly (tested on SiteGround). They MUST go above any WordPress rewrites but below the "RewriteEngine On RewriteBase /" portion.
View .htaccess
# Stop processing any rewrites for /.well-known/ files
RewriteCond %{REQUEST_URI} ^/\.well-known/.*$ [NC]
RewriteRule ^ - [L]
nkt /
Last active May 12, 2020
ReactPHP vs Node.js

wrk -t4 -c400 -d10s


Running 10s test @
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.02ms    6.94ms  82.86ms   85.27%
sc0ttkclark /
Last active May 29, 2020 Mac integration with for diff and merge -
View Mac integration with for diff and merge

You must place both files in the ~/Library/Application Support/com.fournova.Tower2/CompareTools/ directory and chmod +x

Note: For Tower 3 you will need ot place them in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory

This integration is based on the one I found for Beyond Compare's beta integration:


Preparing Plugins for Term Splitting

Historically, two terms in different taxonomies with the same slug (for instance, a tag and a category sharing the slug "news") have shared a single term ID. Beginning in WordPress 4.2, when one of these shared terms is updated, it will be split: the updated term will be assigned a new term ID.

In the vast majority of situations, this update will be seamless and uneventful. However, some plugins and themes store term IDs in options, post meta, user meta, or elsewhere. WP 4.2 will include two different tools to help authors of these plugins and themes with the transition.

The 'split_shared_term' action

When a shared term is assigned a new term ID, a new 'split_shared_term' action is fired. Plugins and themes that store term IDs should hook to this action to perform necessary migrations. The documentation for the hook is as follows:

sc0ttkclark / bbp-optimize.php
Last active Jun 28, 2019
bbPress Optimize -- Optimizes bbPress queries for large bbPress forums
View bbp-optimize.php
Plugin Name: bbPress Optimize
Plugin URI:
Description: Optimizes bbPress queries for large bbPress forums
Version: 1.1
Author: Scott Kingsley Clark
Author URI:
jtsternberg /
Last active Mar 25, 2018
Create a theme options page with CMB2
You can’t perform that action at this time.