This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Steps we will take: | |
# 1. Change Local (Docker Machine) image type (this will take a bit) | |
# 2. Resize image | |
# 3. Resize partion | |
# | |
# Also see: https://docs.docker.com/articles/b2d_volume_resize/ | |
# IMPORTANT: Make sure Local is not running! | |
VM_NAME="local-by-flywheel" | |
NEW_DISK_SIZE=50000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // GP Unique ID // Retroactively Populate Unique IDs | |
* https://gravitywiz.com/documentation/gp-unique-id/ | |
* | |
* 1. Copy and paste this code into your theme's functions.php file. | |
* 2. Go to your home page and add the following parameters to the query string: | |
* | |
* gpui_retro_pop=1 | |
* form_id=123 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Subject = function() { | |
this.observers = []; | |
return { | |
subscribeObserver: function(observer) { | |
this.observers.push(observer); | |
}, | |
unsubscribeObserver: function(observer) { | |
var index = this.observers.indexOf(observer); | |
if(index > -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute | |
// with the value dropzone-wordpress-rest-api-form (or dropzoneWordpressRestApiForm) | |
Dropzone.options.dropzoneWordpressRestApiForm = { | |
//acceptedFiles: "image/*", // all image mime types | |
acceptedFiles: ".jpg", // only .jpg files | |
maxFiles: 1, | |
uploadMultiple: false, | |
maxFilesize: 5, // 5 MB | |
init: function() { | |
console.group('dropzonejs-wp-rest-api:'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Dan Shumaker modified&added features: | |
# 1. Use terminus instead of drush | |
# 2. Save standard options (if user wants to they can save their settings on lines 14-18 and not have to have any cli options) | |
# 3. Auto generate standard live,test,dev enviornment files | |
# 4. Removed dependency on separate spf template file. | |
# | |
# Tested with El Capitan, Sequel Pro 1.1 (Obac 177), terminus 0.10.0 | |
# original: https://gist.github.com/aaronbauman/f50cc691eb3ed60a358c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Update after each step completion - probably executes too often for most use cases | |
add_action( 'gravityflow_step_complete', 'gravityflow_step_complete_post_publish', 10, 4 ); | |
function gravityflow_step_complete_post_publish( $step_id, $entry_id, $form_id, $status ) { | |
$entry = GFAPI::get_entry( $entry_id ); | |
$currentPost = get_post( rgar( $entry, 'post_id' ) ); | |
if("draft" == $currentPost->post_status) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pht_write_file( $id, $post) { | |
$upload_dir = wp_upload_dir(); | |
$file = $upload_dir['basedir']."/publication-hub-tools/test.xml"; | |
$content = $post->post_content; | |
// convert $content to XML... | |
file_put_contents( $file, $content ); | |
} | |
add_action( 'publish_post', 'pht_write_file', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mailpoet_enable_wpmail(){ | |
if(class_exists('WYSIJA')){ | |
$model_config = WYSIJA::get('config','model'); | |
$model_config->save(array('allow_wpmail' => true)); | |
} | |
} | |
add_action('init', 'mailpoet_enable_wpmail'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp_api_encode_acf($data,$post,$context){ | |
$data['meta'] = array_merge($data['meta'],get_fields($post['ID'])); | |
return $data; | |
} | |
if( function_exists('get_fields') ){ | |
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create Custom Meta Boxes for WooCommerce Product CPT | |
* | |
* Using Custom Metaboxes and Fields for WordPress library from | |
* Andrew Norcross, Jared Atchinson, and Bill Erickson | |
* | |
* @link http://blackhillswebworks.com/?p=5453 | |
* @link https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress | |
*/ | |
NewerOlder