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
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
<?php | |
add_filter( 'woocommerce_payment_complete_order_status', 'wmg_auto_complete_virtual_orders', 10, 3 ); | |
/** | |
* Automatically complete orders with only virtual products | |
* | |
* @param string $payment_complete_status Order status used after an order payment is received | |
* @param int $order_id ID of the order being processed | |
* @param WC_Order $order Order object being processed |
<?php | |
/** | |
* Create the image attachment and return the new media upload id. | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
* | |
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below. | |
* | |
* @see https://gist.github.com/hissy/7352933 | |
* |
<?php | |
/** | |
* Plugin name: WP Trac #42573: Fix for theme template file caching. | |
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
* Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
* Author: Weston Ruter, XWP. | |
* Author URI: https://weston.ruter.net | |
*/ | |
function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
<?php // only copy if needed | |
/** | |
* Example: Add order meta to the REST API | |
* WC 2.6+ | |
* | |
* @param \WP_REST_Response $response The response object. | |
* @param \WP_Post $post Post object. | |
* @param \WP_REST_Request $request Request object. | |
* @return object updated response object |
<?php | |
return array( | |
"post_type" => "park", | |
"post_status" => "publish", | |
"posts_per_page" => 100 | |
); |
<?php | |
/* | |
Plugin Name: Conditionally send WooCommerce emails | |
Plugin URI: https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/ | |
Description: Dynamically determine whether to send a WooCommerce email. | |
Author: Damien Carbery | |
Version: 0.2 | |
*/ | |
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc |