View gravity-forms-strip-email-from-name-quotes.php
/** | |
* Replace Quotes in Gravity Forms Email Headers | |
* | |
* For some odd reason Gravity Forms includes quotes in the "From" sender name. This is inconsistent with other mail senders so this removes the quotes. | |
* | |
* @param $email | |
* @param $message_format | |
* @param $notification | |
* | |
* @return mixed |
View formidable-givewp-pass-values-proof-of-concept.php
<?php | |
/** | |
* Passing receipt values to $_GET for formidable forms. | |
* | |
* @see: https://formidableforms.com/knowledgebase/using-dynamic-default-values-in-fields/#kb-pass-a-value-to-a-form | |
* | |
* @param $donation | |
* @param $give_receipt_args | |
*/ |
View shortcode-donor-wall.php
<?php | |
/** | |
* This template is used to display the donation grid with [give_donor_wall] | |
*/ | |
// Exit if accessed directly. | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |
View resize_local_machine.sh
# 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 |
View wp-config.php
define('WP_DEBUG', true); | |
define('SCRIPT_DEBUG',true); | |
if ( WP_DEBUG ) { | |
// Enable Debug logging to the /wp-content/debug.log file | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', true ); | |
@ini_set( 'log_errors', 'On' ); | |
@ini_set( 'display_errors', 'Off' ); | |
@ini_set( 'error_reporting', E_ALL ); | |
@ini_set( 'error_log', 'php_error.log' ); |
View setup-phpunit.sh
#!/usr/bin/env bash | |
# =============================================================================== | |
# Script to install PHPUnit in the Local by Flywheel Mac app | |
# These packages are installed | |
# | |
# PHPUnit, git, subversion, composer, curl and wget | |
# | |
# WordPress and the WP_UnitTestCase are installed in the /tmp directory | |
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file |
View give-tf-custom-styles.css
/* Basic form style cleanup */ | |
ul#give-donation-level-radio-list { | |
list-style: none; | |
padding: 0; | |
} | |
ul#give-donation-level-radio-list input { | |
margin: 0 5px 0 3px; | |
} |
View give-literal-gateway-labels.php
/** | |
* Call Give Payment Gateways by Name | |
* | |
* @param $gateways | |
* | |
* @return mixed | |
*/ | |
function gr_override_gateway_labels( $gateways ) { | |
$gateways['authorize']['checkout_label'] = 'Authorize'; | |
$gateways['stripe']['checkout_label'] = 'Stripe'; |
View give-gateways-reordering.php
/** | |
* Give function to reorder array keys | |
* @see: http://php.net/manual/en/function.ksort.php | |
* reorder the keys of an array in order of specified keynames; all other nodes not in $keynames will come after last $keyname, in normal array order | |
* @param array &$array - the array to reorder | |
* @param mixed $keynames - a csv or array of keynames, in the order that keys should be reordered | |
*/ | |
function give_9812491_my_array_reorder_keys(&$array, $keynames){ | |
if(empty($array) || !is_array($array) || empty($keynames)) return; | |
if(!is_array($keynames)) $keynames = explode(',',$keynames); |
View give-recurring-dummy-subscriptions.php
<?php | |
/** | |
* Create Recurring Dummy Subscriptions | |
*/ | |
$subscription = new Give_Subscription( 68 ); | |
$args = array( | |
'subscription_id' => 68, | |
'amount' => 20, | |
'transaction_id' => md5(uniqid(rand(), true)), |
NewerOlder