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
Block or report user

Report or block sc0ttkclark

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
@sc0ttkclark
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]
@sc0ttkclark
sc0ttkclark / class-fieldmanager-readonly.php
Created Feb 18, 2016
A class you can drop-in to enable readonly text fields that can't be changed, but optionally you can set `'can_edit_capability' => 'manage_options'` to any capability you'd like to restrict editing to. If user has that capability, a basic text field will be used.
View class-fieldmanager-readonly.php
<?php
/**
* Read only text field, optionally allows for specific users to edit
* @package Fieldmanager
*/
class Fieldmanager_ReadOnly extends Fieldmanager_TextField {
/**
* The capability a user must have to be able to edit normally
*
@sc0ttkclark
sc0ttkclark / sort-by-term-name.php
Created Oct 23, 2015
Example PHP of how to enable sorting by term name. `orderby=term_name` and `orderby_tax={taxonomy_name}`
View sort-by-term-name.php
<?php
/**
* Filter EP args to add support for orderby term_name
*
* @param array $formatted_args
* @param array $args
*/
function ep_add_term_name_sort_support( $formatted_args, $args ) {
// Handle meta_value / meta_value_num sort
@sc0ttkclark
sc0ttkclark / 0_reuse_code.js
Created Sep 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View podscast-2-demo.php
<?php
// Setup Speakers pod
$speaker = pods( 'speaker' );
// Find all Speakers
// with Lessons that are in the Series "That Series"
// or that have a Lesson "Awesome Lesson"
$params = array(
'where' => '
lessons.series.post_title = "That Series"
@sc0ttkclark
sc0ttkclark / pods-examples.php
Created Mar 3, 2015
Example from PodsCast 1
View pods-examples.php
<?php
////////////////
// User Example
////////////////
$user = pods( 'user' ); // User
$params = array(
'orderby' => 't.user_login',
'limit' => 10,
@sc0ttkclark
sc0ttkclark / delete-orphan-gf-entry-data.sql
Created Feb 16, 2015
Delete all GF lead data if lead has been deleted
View delete-orphan-gf-entry-data.sql
DELETE
lead_detail
FROM
wp_rg_lead_detail AS lead_detail
LEFT JOIN
wp_rg_lead AS lead ON lead.id = lead_detail.lead_id
WHERE
lead.id IS NULL;
DELETE
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active Jun 18, 2019
PhpStorm.app Mac integration with Tower.app for diff and merge - https://youtrack.jetbrains.com/issue/WI-26090
View 0-README.md

PhpStorm.app Mac integration with Tower.app for diff and merge

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

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

https://github.com/tednaleid/git-tower-beyond-compare-shim

@sc0ttkclark
sc0ttkclark / gistify497541.buddypress-separate-bbpress-forums-site.php
Last active Sep 12, 2015
Code to enable having the main bbPress forums on a separate sub-site. Requires: WP Multisite, BuddyPress on main site and network-activated, bbPress on main site and sub-site
View gistify497541.buddypress-separate-bbpress-forums-site.php
<?php
/**
* Remove and add a custom function for bbPress' BuddyPress activity filter
*/
function custom_bbp_notifications_fix() {
if ( !defined( 'BBPRESS_FORUMS_BLOG_ID' ) || !BBPRESS_FORUMS_BLOG_ID ) {
return;
}
@sc0ttkclark
sc0ttkclark / bbp-optimize.php
Last active Jun 28, 2019
bbPress Optimize -- Optimizes bbPress queries for large bbPress forums
View bbp-optimize.php
<?php
/*
Plugin Name: bbPress Optimize
Plugin URI: https://www.scottkclark.com/
Description: Optimizes bbPress queries for large bbPress forums
Version: 1.1
Author: Scott Kingsley Clark
Author URI: https://www.scottkclark.com/
*/
You can’t perform that action at this time.