Skip to content

Instantly share code, notes, and snippets.

@jamiechong
jamiechong / wpe_bedrock_deploy.sh
Created November 15, 2017 17:28
WPE Bedrock Deploy
#!/bin/bash
#
# Modifed to work with bedrock. Note the hardcoded theme (search for my-theme-name), which could probably be changed to use
# a command line argument.
# Usage:
# ./wpe-deploy.sh wpe-remote-name bedrock-folder
#
# Place this file at the same level as your trellis and bedrock-folder
#
# Version: 2.1
@jamiechong
jamiechong / gist:ed2b569fb879015f66c33eb2cbe6576d
Created July 20, 2017 22:01
Ajax upload file to Wordpress REST API v2 media endpoint
<input type="file" id="file"/>
-----
var file = $('#file')[0].files[0];
$.ajax({
method: "POST",
url: REST_API_URL + 'wp/v2/media',
data: file,