Skip to content

Instantly share code, notes, and snippets.

View tmort's full-sized avatar

Tom Morton tmort

View GitHub Profile
@tmort
tmort / gist:4655945
Created January 28, 2013 14:30
Modify WP auto-logout duration
<?php
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
function keep_me_logged_in_for_1_year( $expirein ) {
return 31556926; // 1 year in seconds
}
@tmort
tmort / wpsocialite.js
Created January 29, 2013 18:27
WPSocialite.js Modified to load the scrolling icons 100 px before window shows them.
jQuery(function($) {
Socialite.process(); //processing each instance before we take any action. Makes sure pinterest loads individually and not all together.
if ( $("body").hasClass("wpsocialite-scroll") ) { //If set to 'scroll'
var articles = $('.social-buttons'), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout;
updateArticles = function()
{
// viewport bounds
map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}
@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));
@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 / Link_to_Author_in_loop.php
Created December 21, 2015 14:47
WordPress link to author page instead of single post
@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 / Readme.md
Last active January 2, 2019 12:22
Nick83 Help with Filters
@tmort
tmort / README.md
Last active April 24, 2024 05:37
NSFW Image Blur WP Plugin
@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
*/