Skip to content

Instantly share code, notes, and snippets.

@JPry
JPry / wc-send-coupons-by-email.php
Last active February 1, 2019 15:38 — forked from woogists/wc-send-coupons-by-email.php
Send coupons used in an order by email
<?php
/**
* Send an email each time an order with coupon(s) is completed
*
* The email contains coupon(s) used during checkout process
*
* @param int $order_id The ID of the order.
*/
function jp_email_order_coupons( $order_id ) {
<?php
add_action( 'woocommerce_customer_changed_subscription_to_cancelled', 'customer_skip_pending_cancellation' );
/**
* Change 'pending-cancel' status directly to 'cancelled'.
*
* @param WC_Subscription $subscription
*/
function customer_skip_pending_cancellation( $subscription ) {
@JPry
JPry / add-editor-style.php
Last active August 29, 2015 14:27 — forked from jtsternberg/add-editor-style.php
add editor style (works for front-end editors as well)
<?php
add_filter( 'mce_css', 'jpry_add_editor_styles' );
/**
* Filter the TinyMCE styles.
*
* @param string $styles The comma-separated list of stylesheets to be loaded by TinyMCE.
*
* @return string The updated comma-separated list of stylesheets to be loaded by TinyMCE.
*/
@JPry
JPry / hhvm.md
Last active August 29, 2015 14:01 — forked from octalmage/gist:11366947
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python-software-properties curl
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'
sudo apt-get update
sudo echo -e "Package: *\nPin: origin ftp.osuosl.org\nPin-Priority: 1000" | tee /etc/apt/preferences.d/mariadb
sudo apt-get install mariadb-server
mysql -uroot -p 
<?php
// full path to customer log file
$log_file = __DIR__.'/../__admin_ajax.log';
// if it's not a POST request, just move along
if($_SERVER['REQUEST_METHOD'] != "POST") {
return(0);
}
// if you only want specific files like admin-ajax or xmlrpc, uncomment the next line
<?php
/**
* WordPress Multisite upgrade script
*
* IMPORTANT: While a simple safeguard has been added to the script,
* you'll want to add another layer that prevents this script from
* being called via the browser.
*
* Usage:
* 1) Place in the root of your install (or another place, but modify the wp-load.php path to match)
@JPry
JPry / admin_htaccess.txt
Created November 7, 2011 21:02 — forked from norcross/admin_htaccess.txt
WCPhilly Admin
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]