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 | |
// These are just the basics for how to do this. Notes: | |
// - Not fully tested. | |
// - Not suitable for production. | |
// - May not work well if large ammounts of data. | |
// - Requires AWS SDK for PHP and http://php.net/manual/en/book.zip.php | |
require '/path/to/sdk-or-autoloader'; |
<?php | |
// In a class constructor | |
$this->size_tax = wc_attribute_taxonomy_name( 'Size' ); | |
$this->color_tax = wc_attribute_taxonomy_name( 'Color' ); | |
// Insert the main product first | |
// It will be used as a parent for other variations (think of it as a container) | |
$product_id = wp_insert_post( array( |
//detects the start of an ajax request being made | |
$(document).on("sf:ajaxstart", ".searchandfilter", function(){ | |
console.log("ajax start"); | |
}); | |
//detects when the ajax request has finished and the content has been updated | |
// - add scripts that apply to your results here | |
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ | |
console.log("ajax complete"); | |
//so load your lightbox or JS scripts here again |
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 | |
/** | |
* The below function will help to load template file from plugin directory of wordpress | |
* Extracted from : http://wordpress.stackexchange.com/questions/94343/get-template-part-from-plugin | |
*/ | |
define('PLUGIN_DIR_PATH','Your-plugin-directory-path'); | |
function ccm_get_template_part($slug, $name = null) { | |
do_action("ccm_get_template_part_{$slug}", $slug, $name); |
<?php | |
add_filter( 'acf/load_field/name=flex_layout', __CLASS__ . '::craft_content_layouts' ); | |
static function craft_content_layouts( $field ) { | |
// Remove the layouts | |
// that are named in this list | |
$remove_list = [ | |
'paragraph', | |
'banner', |
<?php | |
/** | |
* Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer | |
*/ | |
function elementor_css_in_head(){ | |
if(class_exists('\Elementor\Plugin')){ | |
$elementor = \Elementor\Plugin::instance(); | |
$elementor->frontend->enqueue_styles(); | |
} | |
if(class_exists('\ElementorPro\Plugin')){ |
<?php | |
/** | |
* Grab the url of a publicly embeddable video hosted on vimeo | |
* @param str $video_url The "embed" url of a video | |
* @return str The url of the thumbnail, or false if there's an error | |
*/ | |
function grab_vimeo_thumbnail($vimeo_url){ | |
if( !$vimeo_url ) return false; | |
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) ); |
/* | |
* Add our Custom Fields to simple products | |
*/ | |
function mytheme_woo_add_custom_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Text Field |