Skip to content

Instantly share code, notes, and snippets.

@bekarice
bekarice / messages.js
Last active July 9, 2020 18:33 — forked from deivamagalhaes/messages.json
SkyVerge Messages Sample
[
{
"id": "first-test-message", // required
"datePublished": "2020-07-07", // required,
"expirationDate": "2020-08-01", // optional
"subject": "Hey!", // required
"body": "This is a message from the cool folks at SkyVerge", // required
"ctaButton": "View plugin", // optional
"ctaHref": "https://woocommerce.com/product/plugin-slug", // required only if ctaButton included
"visibility": { // all optional
@bekarice
bekarice / user-switching-notice-for-wc.php
Created February 12, 2019 01:40
Uses the "demo store" notice to show a switch back link for WC customer accounts with User Switching: http://cloud.skyver.ge/c50cbcd4c5e7
<?php
/**
* Plugin Name: User Switching Notice for WooCommerce
* Plugin URI: https://gist.github.com/bekarice/7785293fb60d7d5297a245b1c1271272
* Description: Adds a frontend notice to switch back to your user on WooCommerce sites with User Switching.
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: user-switching-notice-for-woocommerce
*
@bekarice
bekarice / yoast-seo-with-coauthors-plus.php
Created April 19, 2018 19:01
Forces Yoast to use the display name directly for the queried object so the proper coauthor name is used as the page title.
<?php // only copy if needed!
/**
* Fixes page titles for co-author archives.
*
* @param string[] $replacement Yoast title settings replacement data
* @return string[] updated data
*/
function br_fix_author_archive_title( $replacement ) {
@bekarice
bekarice / filter-wc-orders-by-gateway.php
Last active August 3, 2023 13:37
Filters WooCommerce Orders by Payment Gateway Used
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
@bekarice
bekarice / sv-background-test.php
Created June 21, 2017 00:54
Provides a plugin to test whether a server will allow background job processing or not for WooComm import / export plugins.
<?php
/**
* Plugin Name: Background Processing Test for Import / Export
* Plugin URI: http://skyverge.com/
* Description: Tests whether or not the server can connect to itself to process jobs asynchronously.
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: sv-background
*
@bekarice
bekarice / wc-hold-cod-orders.php
Created April 19, 2017 23:56
Force COD orders to 'on hold'
<?php // only copy if needed
/**
* Forces orders be marked as "on hold
*/
function sv_wc_cod_order_status( $status ) {
return 'on-hold';
}
add_filter( 'woocommerce_cod_process_payment_order_status', 'sv_wc_cod_order_status', 15 );
@bekarice
bekarice / prefix-wc-order-number.php
Created April 10, 2017 20:34
Add WooCommerce Order number prefix
<?php // only copy if needed
/**
* Adds a prefix to the existing WooCommerce order number.
*
* @param int $order_id the order ID
* @param \WC_Order $order the order object
* @return string the updated order number
*/
function sv_wc_add_order_number_prefix( $order_id, $order ) {
<?php // Don't copy me unless you need to!
/**
* Changes the coupon label output from Coupon: {code} to Coupon: {description}
*
* @param string $label the cart / checkout label
* @param \WC_Coupon $coupon coupon object
* @return string updated label
*/
function swwp_change_coupon_preview( $label, $coupon ) {