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 / 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": {
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 / .bowerrc
Created Jan 30, 2019
BowerRC with ignored WP core JS files
View .bowerrc
"directory": "assets/",
"ignoredDependencies": [
wpsmith / android-ios-example.html
Created Jan 28, 2019
AppPresser 3 Custom Page Example: How to target a specific platform(Android/iOS) example linking to either Google Maps on Android or Apple Maps on iOS
View android-ios-example.html
<div style="padding: 20px; font-size: 2rem;">
<strong>My Company Name</strong><br>
123 Main St<br>
City, ST 12345<br>
<div *ngIf="'ios') "><a class="button" onclick="',+City,+ST+12345', '_system'); return false;">Get Directions</a></div>
<div *ngIf=" !'ios') "><a class="button" onclick="',+City,+ST+12345', '_system'); return false;">Get Directions</a></div>
Phone: <a href="tel:+1-123-456-7890">(123) 456-7890</a><br>
wpsmith / composer.json
Last active Jan 11, 2019
PHP: Hide User Mu-Plugin
View composer.json
"name": "wpsmith/hide-user",
"description": "Hides user in WordPress Admin.",
"type": "project",
"license": "GPLv2+",
"authors": [
"name": "Travis Smith",
"email": ""
wpsmith / composer-landing-pages.json
Last active Jan 5, 2019
WordPress: Rewrite Tutorial
View composer-landing-pages.json
"name": "wpsmith/post-type-taxonomy-rewrite",
"description": "Rewrite for {taxonomy}/{postname} rewrites.",
"type": "project",
"license": "GPLv2+",
"authors": [
"name": "Travis Smith",
"email": ""
View wordpress-javascript-functions.php
Using the native WordPress functions and Script Manager (`WP_Scripts`).
Functions include:
wpsmith / base-post.graphql
Last active May 16, 2018
GraphQL Caching Problems
View base-post.graphql
observations(geocode: "38.00,-97.00", unit: METRIC, locale: "en-US") {
astro(locId:"38.00,-97.00", language:"en-US", min:0, max:3) {
sun {
riseSet {
You can’t perform that action at this time.