Skip to content

Instantly share code, notes, and snippets.

Travis Smith wpsmith

Block or report user

Report or block wpsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wpsmith /
Created Jun 18, 2019
SH: Uploads file to IBM Cloud Object Storage (US Standard)
#!/usr/bin/env bash
# Set AWS credentials and S3 paramters
wpsmith / taxonomies.php
Created May 30, 2012
Registering Multiple Taxonomies
View taxonomies.php
* Taxonomies
* This file registers any custom taxonomies
* @package WPS_Starter_Genesis_Child
* @author Travis Smith <>
* @copyright Copyright (c) 2012, Travis Smith
* @license GNU Public License
wpsmith / .bash_profile
Created Aug 28, 2013
SSH: .bash_profile
View .bash_profile
# =============================================================== #
# PERSONAL $HOME/.bashrc FILE for bash-3.0 (or later)
# By Emmanuel Rouat [no-email]
# Last modified: Tue Nov 20 22:04:47 CET 2012
# This file is normally read by interactive shells only.
#+ Here is the place to define your aliases, functions and
#+ other interactive features like your prompt.
wpsmith / is_rest.php
Last active Jun 4, 2019
PHP: Determines whether the request is a WordPress API request.
View is_rest.php
* Determines whether the current request is a RESTful request.
* @return bool
function is_rest() {
return (
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
wpsmith / composer.json
Created May 5, 2019
CMB Autoloading with Composer
View composer.json
"require": {
"php": ">=5.3.0",
"composer/installers": "v1.0.12",
"webdevstudios/cmb2": "dev-master"
"autoload": {
"files": ["vendor/cmb2/init.php"]
"extra": {
View wordpress-javascript-functions.php
Using the native WordPress functions and Script Manager (`WP_Scripts`).
Functions include:
wpsmith / gist:6067068
Created Jul 23, 2013
RegEx: Notepad++ Append & Prepend to each line
View gist:6067068
Press CTRL-H to bring up the Find/Replace Dialog. Choose the "Regular expressions" checkbox near the bottom of the dialog.
To add "test" to the beginning of each line, type "^" in the "Find what" field, and "test" in the "Replace with" field. Then hit "Replace All".
To add "test" to the end of each line, type "$" in the "Find what" field, and "test" in the "Replace with" field. Then hit "Replace All".
wpsmith / isotope.php
Created Nov 16, 2012
PHP: Properly Load Isotope
View isotope.php
add_action( 'wp_enqueue_scripts', 'wps_load_scripts' );
* Enqueue Isotope
* For commercially developed child themes, you must obtain a license
* from for approx. $25.
* @link
* @link
* @link
wpsmith / PHP composer
Created Feb 27, 2019 — forked from davebarnwell/PHP composer
Global installation of PHP tools with Composer
View PHP composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
wpsmith / gs_set_bp_profile_fw.php
Created Apr 29, 2014
PHP: Force Full-Width for BuddyPress within Genesis
View gs_set_bp_profile_fw.php
add_action( 'get_header', 'gs_set_bp_profile_fw' );
* Make BuddyPress pages full width.
* @uses bp_current_component() Checks if current page is showing BuddyPress component.
function gs_set_bp_profile_fw() {
You can’t perform that action at this time.