Skip to content

Instantly share code, notes, and snippets.

View rvdsteege's full-sized avatar

Reüel van der Steege rvdsteege

View GitHub Profile
@rvdsteege
rvdsteege / SetupDevEnv.sh
Last active February 8, 2016 09:54
Script to set up an OS X development environment (Nginx + PHP + MariaDB + Dnsmasq + Homebrew + Composer + npm + wp-cli + grunt-cli + php-code-sniffer + phpmyadmin) easily and quickly. Result after running this script: folders in ~/www/ can be accessed at http://dirname.dev/ without modifying the hosts file. Script provided "AS IS", without any w…
#!/bin/bash
# make executable: chmod +x file
echo -e "\033[7m INSTALL XCODE DEVELOPER TOOLS \033[27m"
xcode-select --install
echo -e "\033[7m HOMEBREW - INSTALL \033[27m"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo -e "\033[7m HOMEBREW - DOCTOR \033[27m"
@rvdsteege
rvdsteege / woocommerce-tab-link.js
Created January 19, 2018 10:04
jQuery script to be able to link to WooCommerce tabs from anywhere on the page. Use link href "#wc-tab-XXX" (XXX corresponds to name of the tab as used by WooCommerce; use browser developer tools to determine).
@rvdsteege
rvdsteege / functions.php
Created September 28, 2018 07:41
Update field in Gravity Forms entry with IBAN on successful payment with Pronamic Pay.
<?php
/**
* Gravity Forms iDEAL fulfillment hook.
*
* @link https://github.com/wp-pay-extensions/gravityforms/blob/2.1.2/src/Extension.php#L729-L730
*
* @param array $entry Gravity Forms entry.
* @param \Pronamic\WordPress\Pay\Extensions\GravityForms\PayFeed $feed Payment feed.
*/
@rvdsteege
rvdsteege / pronamic-pay-status-update-notice.php
Last active March 11, 2019 11:28
Pronamic Pay status update notice by email.
<?php
// Add below code to functions.php of your WordPress theme.
/**
* Pronamic Pay status update notice.
*
* @param Payment $payment The payment.
* @param bool $can_redirect Whether or not to redirect.
* @param string $old_status Old paymet status.
* @param string $new_status New payment status.
@rvdsteege
rvdsteege / pronamic-pay-privacy-erasure-by-email-address.php
Created March 13, 2019 14:48
Pronamic Pay privacy erasure by email address.
<?php
/**
* Pronamic Pay privacy erasure by email address.
*/
$emails = array();
$privacy_erasers = pronamic_pay_plugin()->privacy_manager->register_erasers( array() );
foreach ( $emails as $email ) {
foreach ( $privacy_erasers as $eraser ) {
@rvdsteege
rvdsteege / pronamic-wpseo-set-canonical.php
Last active June 13, 2019 09:58
Set Yoast SEO canonical URL meta for given post types and taxonomies to current link and perform given URL replacements.
<?php
/**
* Set Yoast SEO canonical URL meta for given post types and taxonomies
* to current link and perform given URL replacements.
*
* To run, set query variable: `/wp-admin/?pronamic_set_canonical=true`.
*
* @return void
*/
@rvdsteege
rvdsteege / pronamic-pay-buckaroo-use-brq-parameter.php
Created August 26, 2019 08:04
Get the value of a Buckaroo parameter on payment status changes with the Pronamic Pay plugin for WordPress.
<?php
// Add below code to functions.php of your WordPress theme.
/**
* Pronamic Pay status update process Buckaroo parameter.
*
* @param Payment $payment The payment.
* @param bool $can_redirect Whether or not to redirect.
* @param string $old_status Old paymet status.
* @param string $new_status New payment status.
@rvdsteege
rvdsteege / pronamic-pay_woocommerce-subscriptions_keep-subscriptions-active-during-renewal.php
Last active February 11, 2020 19:18
Pronamic Pay + WooCommerce Subscriptions — Keep subscriptions 'active' instead of going 'on hold' during renewal.
/*
* WooCommerce Subscriptions - Skip order status 'On hold'.
*/
add_filter( 'pronamic_payment_status_update_woocommerce_unknown_to_open', 'pronamic_pay_wcs_skip_on_hold', 10, 2 );
function pronamic_pay_wcs_skip_on_hold( $payment, $can_redirect ) {
if ( 'woocommerce' !== $payment->get_source() ) {
return;
}
@rvdsteege
rvdsteege / pronamic_pay_subscription_cancel_redirect_url.php
Last active February 14, 2020 08:42
Snippet to customise the Pronamic Pay cancel redirect URL.
<?php
/**
* Pronamic Pay custom subscription cancel redirect URL.
*/
add_action( 'pronamic_subscription_status_update_gravityformsideal', 'pronamic_pay_subscription_cancel_redirect_url', 10, 1 );
function pronamic_pay_subscription_cancel_redirect_url( $subscription ) {
$redirect_url = home_url();
@rvdsteege
rvdsteege / pronamic-pay-adyen-payment-metadata.php
Last active April 16, 2020 14:53
Usage example for Pronamic Pay `pronamic_pay_adyen_payment_metadata` filter.
<?php
/**
* Pronamic Pay Adyen payment metadata.
*
* @param array $metadata Metadata.
* @param Payment $payment Payment.
*
* @return array
*/