Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Shreve justinshreve

View GitHub Profile
View enable-new-wc-onboarding.php
<?php
/*
Plugin Name: Enable WooCommerce Onboarding Split Test
Description: Puts the site into the test group for WooCommerce Onboarding split testing.
Version: 1.0.0
Author: Automattic
License: GPL2
*/
function woocommerce_admin_set_test_group() {
return 'b';
@justinshreve
justinshreve / send-auto-update-debug-email.php
Created Jul 19, 2017
Sends debug emails for WP auto updates
View send-auto-update-debug-email.php
<?php
/**
* Plugin Name: Send Automatic Update Debug Emails
* Description: Sends automatic Update Debug Emails
* Version: 0.1
*/
add_filter( 'automatic_updates_send_debug_email', '__return_true' );
View auto-update.php
<?php
// Force an auto update
require( dirname(__FILE__) . '/wp-load.php' );
delete_option( 'auto_updater.lock' );
wp_maybe_auto_update();
View legacy-customer-filter-test.php
<?php
/**
* Legacy Customers API Tests
* @package WooCommerce\Tests\API
*/
class WC_Tests_API_Legacy_Customers extends WC_API_Unit_Test_Case {
/** @var WC_API_Customers instance */
protected $endpoint;
@justinshreve
justinshreve / wc-refund-item-info.php
Last active Feb 21, 2017
WooCommerce: Get item info from refunds
View wc-refund-item-info.php
<?php
// Get items from all refunds
$refunds = array();
$refund_items = get_posts( array(
'post_type' => 'shop_order_refund',
'posts_per_page' => -1,
'post_status' => 'any',
'fields' => 'ids'
) );
@justinshreve
justinshreve / woocommerce-cancel-unpaid-bookings.php
Created Nov 2, 2015
Allows WooCommerce booking orders to be canceled by the cancel unpaid orders cron job.
View woocommerce-cancel-unpaid-bookings.php
<?php
/*
* Plugin Name: Cancel Unpaid Bookings
* Author: WooThemes
* Description: Allows booking orders to be canceled by the cancel unpaid orders cron job.
*/
// woocommerce-cancel-unpaid-bookings.php
function woocommerce_cancel_unpaid_booking_orders_from_admin( $return, $order ) {