Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Blackbourn lumpysimon

View GitHub Profile
View gist:5583782
$trace=debug_backtrace();
$caller=array_shift($trace);
error_log( "Lumpy: mail debug function " . print_r( $trace[0]['function'] , true ) );
error_log( "Lumpy: mail debug class " . print_r( $caller['class'] , true ) );
@lumpysimon
lumpysimon / WordPress Webkit Line Height Fixer
Last active Aug 29, 2015
Quick n dirty fix to strip out the line height styles inserted by Webkit browsers when saving posts in WordPress.
View WordPress Webkit Line Height Fixer
<?php
/*
Plugin Name: Webkit Line Height Fixer
Plugin URI: https://twitter.com/lumpysimon
Description: Remove the annoying inline line-height styles added by Webkit
Version: 1.0
Author: Simon Blackbourn @ Lumpy Lemon
Author URI: http://lumpylemon.co.uk
@lumpysimon
lumpysimon / .gitignore
Last active Sep 28, 2020
A .gitignore file for WordPress that ignores pretty much everything except for the specified plugin(s), theme(s) and mu-plugins folder
View .gitignore
# .gitignore file for WordPress that ignores everything except:
#
# - .gitignore
# - favicon.ico
# - wp-config.php
# - everything in mu-plugins
# - my-plugin
# - my-theme (except for .sass-cache)
#
# based on https://gist.github.com/jdbartlett/444295
View lumpy-responsive-columns.scss
/*
===========
= columns =
===========
*/
$gutter: 4%;
@lumpysimon
lumpysimon / lumpy-responsive-columns.htm
Created Jun 18, 2014
Responsive columns HTML markup
View lumpy-responsive-columns.htm
<section class="cols">
<div class="col col-3-5">
<div class="cols">
<div class="col col-1-3">
<div class="button">one third of three fifths</div>
</div>
<div class="col col-1-3">
<div class="button">one third of three fifths</div>
</div>
<div class="col col-1-3">
@lumpysimon
lumpysimon / gist:2942fa7d71859c35f566
Created Oct 1, 2014
Better XML Sitemaps (WordPress plugin): set cache folder and exclude pages
View gist:2942fa7d71859c35f566
<?php
defined( 'ABSPATH' ) or die();
$ll_sitemap = new ll_sitemap;
@lumpysimon
lumpysimon / gist:5a68f561fd2381e64efe
Last active Mar 8, 2016
Example WordPress custom post type and taxonomy definitions using Extended CPTs and Extended Taxos
View gist:5a68f561fd2381e64efe
register_extended_post_type(
'newsletter',
array(
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 45,
'quick_edit' => false,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'admin_cols' => array(
'newsletter-image' => array(
@lumpysimon
lumpysimon / gist:545c54e2876ebcbaf3c0
Created Jul 7, 2015
Set the WordPress password-protected post cookie expiry time
View gist:545c54e2876ebcbaf3c0
add_filter( 'post_password_expires', 'my_cookie_time' );
function my_cookie_time( $time ) {
return 600; // 600 = 10 minutes. Use 0 to expire the cookie at the end of the current browsing session.
}
@lumpysimon
lumpysimon / hyphenate.css
Created Sep 30, 2015
Bulletproof hyphenation using CSS
View hyphenate.css
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@lumpysimon
lumpysimon / wp-disable-rest.php
Created Nov 26, 2015
Completely disable WordPress REST API
View wp-disable-rest.php
add_filter( 'rest_enabled', '_return_false' );
add_filter( 'rest_jsonp_enabled', '_return_false' );
You can’t perform that action at this time.