Created
July 16, 2021 10:33
-
-
Save fitimvata/09b177f8c822c8a2ffedf987058f0fe3 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Plugin Name: Fix woocommerce admin analytics performance issue | |
* Plugin URI: | |
* Description: | |
* Version: 1.0.0 | |
* Author: | |
* Author URI: | |
* License: MIT | |
*/ | |
add_filter('posts_where', function ($where, WP_Query $wp_query) { | |
if ($wp_query->get('low_in_stock')) { | |
$wp_query->set('low_in_stock', false); | |
} | |
return $where; | |
}, 9, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!! worked like a charm!! low stock query was blocking my website!!