Skip to content

Instantly share code, notes, and snippets.

View tylerdigital's full-sized avatar

Nathan Tyler tylerdigital

View GitHub Profile
add_filter( 'ssa_mailchimp_subscriber_data', 'ssa_set_custom_mailchimp_merge_fields', 10, 3 );
function ssa_set_custom_mailchimp_merge_fields( $subscriber_data, $customer_information, $appointment_type_id ) {
$subscriber_data['merge_fields']['SITUATION'] = $customer_information['Current Situation'];
return $subscriber_data;
}
@tylerdigital
tylerdigital / gist:717d432cf71bd87f7bd4
Last active August 12, 2018 13:24
Advanced Custom Logic workflow with Gravity Forms to Asana
<?php
add_filter( 'gfasana_task_details', 'my_custom_asana_logic', 10, 5 );
function my_custom_asana_logic( $asana_task, $user_index, $project_index, $entry, $form ) {
/* $asana_task array format: */
/*
Array
(
[workspace] => 1234567890123 // don't change this almost ever
[name] => New Task - overridden // string of text for task name
[notes] => long description here // string of texgt
@tylerdigital
tylerdigital / gist:c127ae0c33f456b1f6c6
Created December 31, 2014 20:43
Fix WordPress Hierarchical Post Performance Issue
add_action( 'pre_get_posts', array( $this, 'fix_hierarchy_performance_issue' ) );
function fix_hierarchy_performance_issue( $query ) {
if ( $query->query['post_type']=='hotspot' && $query->query['orderby']=='menu_order title' ) {
$query->set( 'orderby', 'menu_order title post_name' );
}
}
@tylerdigital
tylerdigital / gist:e5616db2def62fc94af1
Created May 28, 2015 19:25
Update WordPress plugins and commit to git with WP-CLI
for plugin in `/usr/local/bin/wp plugin list --update=available --field=name`; do
/usr/local/bin/wp plugin update $plugin
git add .
git add -u .
git commit -m "Updating plugin $plugin"
done
#!/bin/bash
if [[ -z $3 ]]; then
echo "usage $0
type (plugin or theme)
message
directory"
exit;
fi
if [[ $1 != 'plugin' && $1 != 'theme' ]]; then
echo "Type is not plugin or theme! Goodbye!"
@tylerdigital
tylerdigital / helpscout-rest-controller.php
Created March 31, 2016 06:06 — forked from bradyvercher/helpscout-rest-controller.php
A starter WP REST API controller for creating a Dynamic App for Help Scout. http://developer.helpscout.net/custom-apps/dynamic/
<?php
/**
* Help Scout REST controller class.
*
* @license GPL-2.0+
* @link http://developer.helpscout.net/custom-apps/dynamic/
*/
class HelpScout_REST_Controller {
/**
* Secret key.
<?php
/*
Plugin Name: BP Registration Options - Restrict Access Add-On
Plugin URI: http://tylerdigital.com
Description: Add additional restrictions to unapproved members (restrict access to pages/posts)
Version: 1.0
Author: Tyler Digital
Author URI: http://tylerdigital.com
*/
@tylerdigital
tylerdigital / td-post-by-email.php
Created June 18, 2013 20:54
A rough plugin for adding action tags to Jetpack's Post By Email. Note, these only get executed when clicking publish/update in the wp-admin currently. This is a project for personal use, any my needs were to publish a draft by email quickly, and then publish via the web interface. Some additional work would be necessary to have the tags execute…
<?php
/*
Plugin Name: Post By Email Customizations
Plugin URI: http://tylerdigital.com
Description: Handle Jetpack Post By Email – featured images, post formats, post content
Version: 1.0
Author: Tyler Digital
Author URI: http://tylerdigital.com
*/
<?php
// Fetch vars
$event = array(
'id' => $_GET['id'],
'title' => $_GET['title'],
'address' => $_GET['address'],
'description' => $_GET['description'],
'datestart' => $_GET['datestart'],
'dateend' => $_GET['dateend'],
'address' => $_GET['stage']