Skip to content

Instantly share code, notes, and snippets.

@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@jtsternberg
jtsternberg / wp-api-csv.php
Created July 13, 2015 21:01
download a csv from the json rest api
<?php
function check_for_csv_and_overload( $served, $result, $request, $wp_rest_server ) {
if ( ! isset( $_GET['_csv'] ) ) {
return $served;
}
if ( empty( $result->data ) ) {
return $served;
}