This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
function sv_add_weight_to_csv_export_import_format( $order_data, $order ) { | |
$count = 1; | |
// add line items | |
foreach ( $order->get_items() as $item ) { | |
$product = $order->get_product_from_item( $item ); | |
if ( ! is_object( $product ) ) { |
<?php | |
/* | |
Plugin Name: Custom Admin Bar Link | |
Plugin URI: http://www.creare.co.uk | |
Description: This simple plugin adds custom link to the Admin Bar Menu with the option of having a supporting icon. | |
Version: 0.1 | |
Author: James Bavington | |
Author URI: https://twitter.com/jamesbavington | |
*/ |
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
<?php | |
/** | |
* Get subscribers count via the MailChimp API. | |
*/ | |
function mailchimp_get_subscribers_count() { | |
$cache_key = 'mailchimp-subscribers'; | |
$api_key = ''; | |
$username = ''; | |
$dc = ''; | |
$list_id = ''; |
<?php | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ | |
// Step 1 - Keep track of cart contents | |
add_action('wp_loaded', function() { | |
// This variable must be global, we will need it later. If this code were | |
// packaged as a plugin, a property could be used instead | |
global $allowed_cart_items; | |
// We decided that products with ID 737 and 832 can go together. If any of them | |
// is in the cart, all other products cannot be added to it | |
$restricted_cart_items = array( | |
737, | |
832, |
Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.
If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3
HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.
Follow along...
#!/bin/bash | |
# Usage: ./update-mysql56.sh | |
# Backup of all databases... JUST IN CASE | |
mysqldump --all-databases --single-transaction --events --user=root --password > ~/all_database_backup.sql | |
# Remove MySQL 5.5 | |
sudo apt-get remove mysql-server | |
sudo apt-get autoremove |
<?php | |
/* | |
Plugin Name: Woocommerce Bookings Dropdown | |
Description: Swaps the date picker for a dropdown of dates | |
Version: 1.0.0 | |
Author: Webby Scots | |
Author URI: http://webbyscots.com/ | |
*/ | |
add_action('wp_ajax_wswp_refresh_dates','wswp_refresh_dates'); | |
add_action('wp_ajax_nopriv_wswp_refresh_dates','wswp_refresh_dates'); |
As someone that regularly has multiple SSH/VPN sessions open, it can be a huge inconvience to lose all the connections when I lock my screen to get up to go to a meeting, lunch, etc. This is especially true for those connections that require two factor authentication. So, how can I tell my MacBook to keep those connections alive, even though my screen is locked?
Well, turns out that it is pretty simple. All that is needed is to run the following command.
cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO