This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Step 1. Add the filters surrounding the get_terms (which should be used in your code) | |
add_filter( 'terms_clauses', 'rs_replace_inner_with_straight_joins', 20 ); | |
$terms = get_terms( $args ); | |
remove_filter( 'terms_clauses', 'rs_replace_inner_with_straight_joins', 20 ); | |
// Step 2. Add to functions.php or similar: | |
function rs_replace_inner_with_straight_joins( $pieces, $taxonomies = null, $args = null ) { | |
global $wpdb; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Attributes shortcode callback. | |
*/ | |
function so_39394127_attributes_shortcode( $atts ) { | |
global $product; | |
if( ! is_object( $product ) || ! $product->has_attributes() ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE | |
FROM wp_woocommerce_order_itemmeta | |
WHERE order_item_id IN ( | |
SELECT order_item_id | |
FROM wp_woocommerce_order_items | |
WHERE order_id IN ( | |
SELECT ID | |
FROM wp_posts | |
WHERE post_date < '2017-01-01' | |
) |
OlderNewer