Skip to content

Instantly share code, notes, and snippets.

View tmort's full-sized avatar

Tom Morton tmort

View GitHub Profile
@tmort
tmort / README.md
Last active May 4, 2020 00:59
WordPress Worker Verify [Reddit Answer] [Updated]

WordPress Verify Worker

This is a response to a reddit post where a user wants to allow public users to verify if a "worker" (employee) works at the company based on an employee ID.

Original Reddit Post

https://www.reddit.com/r/Wordpress/comments/g3n5wv/wordpress_worker_verify/
Hello guys,
@tmort
tmort / docker-compose.override.yml
Last active October 22, 2019 15:25
Devilbox Override to replace devilbox/docker-apache-2.4 with sixfoot3/docker-apache-2.4
# IMPORTANT: The version must match the version of docker-compose.yml
version: '2.1'
services:
# ------------------------------------------------------------
# Web Server
# ------------------------------------------------------------
httpd:
image: sixfoot3/docker-apache-2.4:latest
hostname: httpd
@tmort
tmort / functions.php
Last active May 17, 2019 15:27
WordPress custom class per page based on object name.
<?php
add_filter('body_class', 'sf3_custom_body_class');
function sf3_custom_body_class($classes){
global $post;
$prefix = 'cpgname_'; //insert your own prefix
if(isset($post->post_type)){ //if a post-type is required
$prefix .= sprintf('%s_%s', $prefix, $post->post_type);
// 'cpgname_page'
@tmort
tmort / sf3_imgparam.php
Last active January 22, 2019 21:44
sf3_imgparam.php
<?php
/*
Plugin Name: SF3 Image Param Shortcode
Plugin URI: https://gist.github.com/tmort/bdb338d362874cdaa0569f1e6ec7f23d/edit
Description: Shortcode that allows parameters to be used in an image string.
Version: 0.1.0
Author: Tom
Author URI: https://sixfoot3.com
*/
@tmort
tmort / README.md
Last active August 22, 2022 19:08
NSFW Image Blur WP Plugin
@tmort
tmort / Readme.md
Last active January 2, 2019 12:22
Nick83 Help with Filters
@tmort
tmort / gw-gravity-forms-disable-submit.php
Created April 18, 2017 03:35 — forked from spivurno/gw-gravity-forms-disable-submit.php
Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
<?php
/**
* Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
*
* Disable submit buttones until all required fields have been filled out. Currently only supports single-page forms.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@tmort
tmort / Link_to_Author_in_loop.php
Created December 21, 2015 14:47
WordPress link to author page instead of single post
@tmort
tmort / gist:560e551a675b5a4ec329
Created August 5, 2015 16:35
Codeable Priority Gmail/Google Apps Inbox
//Detects message from Codeable that a user has written to you
from:notifications@codeable.co "wrote a message"
@tmort
tmort / themehelper.php
Last active February 9, 2016 11:58
WordPress - Find my Template Files
// You will need to uncomment the following line
//define('WP_LOCAL_DEV', true);
add_action ('wp_footer', 'view_template_files');
if (! function_exists ('view_template_files')):
function view_template_files () {
if (defined ('WP_LOCAL_DEV') && WP_LOCAL_DEV) {
global $template;
$template_name = basename($template, '.php');
$template_dir = basename(dirname($template));