Created
August 23, 2023 17:02
-
-
Save barryhughes/92cd5de8f8c2af8759ea4f64a72bd240 to your computer and use it in GitHub Desktop.
"Nullify" the top seller query, within the WooCommerce Status dashboard widget (might be helpful, until such time as the query results are cached).
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 | |
/** | |
* The top-seller query (used for the WooCommerce Status dashboard widget) | |
* runs on every dashboard request. | |
* | |
* It can effectively be nullified using this snippet, if the performance | |
* impact is too great. | |
* | |
* (Tested with WC 8.0.2) | |
*/ | |
add_filter( 'woocommerce_dashboard_status_widget_top_seller_query', function () { | |
return [ 'SELECT NULL' ]; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment