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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Search by Algolia for WooCommerce - Instant & Relevant results | |
*/ | |
/** | |
* If Algolia is not active, let users know. |
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-user-registration-skip-registration-for-existing-email.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists | |
* | |
* If submitted email is already registered, skip registration. |
<?php | |
return array( | |
"post_type" => "park", | |
"post_status" => "publish", | |
"posts_per_page" => 100 | |
); |
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
add_filter( 'woocommerce_checkout_fields', 'filter_checkout_fields' ); | |
function filter_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['maxlength'] = 200; | |
return $fields; | |
} |
<?php | |
/** | |
* Create the image attachment and return the new media upload id. | |
* | |
* @author Joshua David Nelson, [email protected] | |
* | |
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below. | |
* | |
* @see https://gist.github.com/hissy/7352933 | |
* |
add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 ); | |
/** | |
* Add used coupons to the order confirmation email | |
* | |
*/ | |
function add_payment_method_to_admin_new_order( $order, $is_admin_email ) { | |
if ( $is_admin_email ) { | |
<?php | |
// Exclude coupons from being applied when products on sale | |
add_filter( 'woocommerce_coupon_is_valid', 'woocommerce_coupon_check_sale_items', 10, 2 ); | |
function woocommerce_coupon_check_sale_items( $valid, $coupon ) { | |
global $woocommerce; | |
$valid_for_cart = $valid; | |
if (sizeof($woocommerce->cart->get_cart())>0) : foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) : | |
if ( function_exists( 'get_product') ) | |
$product = get_product( $cart_item['product_id'] ); |
<?php | |
$lines = explode( "\n", file_get_contents( 'input.csv' ) ); | |
$headers = str_getcsv( array_shift( $lines ) ); | |
$data = array(); | |
foreach ( $lines as $line ) { | |
$row = array(); | |
foreach ( str_getcsv( $line ) as $key => $field ) |