Skip to content

Instantly share code, notes, and snippets.

@anthonycoffey
anthonycoffey / WP REST API Controller Class
Created October 14, 2018 01:51 — forked from JMWebDevelopment/WP REST API Controller Class
This is the base WP REST API Controller class
<?php class Sports_Bench_Team_REST_Controller extends WP_REST_Controller {
/**
* Register the routes for the objects of the controller.
*/
public function register_routes() {
$namespace = 'sportsbench';
$base = 'teams';
register_rest_route( $namespace, '/' . $base, array(
array(
@anthonycoffey
anthonycoffey / states_hash.json
Created August 23, 2018 16:48 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@anthonycoffey
anthonycoffey / gp-copy-cat-copy-label.html
Last active August 13, 2018 06:29 — forked from spivurno/gp-copy-cat-copy-label.html
Gravity Perks // GP Copy Cat // Copy Label (instead of Value)
<!--
Gravity Perks // GP Copy Cat // Copy Label (instead of Value)
http://gravitywiz.com/documentation/gravity-forms-copy-cat/
Instructions:
1. Add an HTML field to your form.
2. Copy and paste the entire contents of this snippet into the "Content" field setting.
-->
<script>
gform.addFilter( 'gppc_copied_value', function( value, $elem, data ) {