Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tom J Nowell tomjn

🎯
Focusing
View GitHub Profile
View build.sh
#!/bin/bash
# Takes a composer controlled repo and pushes a
# composed PACKAGE into a branch called "PACKAGE".
(
# SANITY CHECKS
# Check for uncommitted changes, and refuse to proceed if there are any
if [ -n "$(git ls-files . --exclude-standard --others)" ]; then
@tomjn
tomjn / gist:4148899
Created Nov 26, 2012 — forked from jmdodd/gist:4055427
Set Twitter language for WordPress oEmbeds
View gist:4148899
global $wp_version;
if ( version_compare( $wp_version, '3.5', 'ge' ) ) {
if ( !function_exists( 'ucc_oembed_twitter_lang' ) ) {
function ucc_oembed_twitter_lang( $provider, $url, $args ) {
if ( stripos( $url, 'twitter.com' ) ) {
if ( defined( 'WPLANG' ) )
$lang = strtolower( WPLANG );
if ( empty( $lang ) )
$lang = 'en';
View gist:4996601
<?php
if ( function_exists( 'contact_detail' ) ) {
$chair = contact_detail( 'chair' );
$address = contact_detail( 'address' );
}
@tomjn
tomjn / shortcode.php
Last active Dec 16, 2015 — forked from r-a-y/shortcode.php
Always ommit trailing php close tags, indent correctly, and remove the IDE unfriendly shorthand
View shortcode.php
<?php
if ( ! function_exists( 'shortcode_exists' ) ) {
/**
* Check if a shortcode is registered in WordPress.
*
* Examples: shortcode_exists( 'caption' ) - will return true.
* shortcode_exists( 'blah' ) - will return false.
*/
function shortcode_exists( $shortcode = false ) {
global $shortcode_tags;