Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Morton tmort

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

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 Oct 22, 2019
Devilbox Override to replace devilbox/docker-apache-2.4 with sixfoot3/docker-apache-2.4
View docker-compose.override.yml
# 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
WordPress custom class per page based on object name.
View functions.php
<?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 Jan 22, 2019
sf3_imgparam.php
View 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 May 3, 2019
NSFW Image Blur WP Plugin
View README.md
@tmort
tmort / Readme.md
Last active Jan 2, 2019
Nick83 Help with Filters
View Readme.md
@tmort
tmort / gw-gravity-forms-disable-submit.php
Created Apr 18, 2017 — forked from spivurno/gw-gravity-forms-disable-submit.php
Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
View gw-gravity-forms-disable-submit.php
<?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 Dec 21, 2015
WordPress link to author page instead of single post
View Link_to_Author_in_loop.php
@tmort
tmort / gist:560e551a675b5a4ec329
Created Aug 5, 2015
Codeable Priority Gmail/Google Apps Inbox
View gist:560e551a675b5a4ec329
//Detects message from Codeable that a user has written to you
from:notifications@codeable.co "wrote a message"
@tmort
tmort / themehelper.php
Last active Feb 9, 2016
WordPress - Find my Template Files
View themehelper.php
// 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));