diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfd6caa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/vendor +composer.lock \ No newline at end of file diff --git a/wc-performance-improvements.php b/wc-performance-improvements.php index 0926891..1404d5f 100644 --- a/wc-performance-improvements.php +++ b/wc-performance-improvements.php @@ -17,7 +17,21 @@ * @package WooCommerce_Performance_Improvements * @author Luke Cavanagh */ - + +use Automattic\WooCommerce\Utilities\FeaturesUtil; + +/** + * Declaring compatibility for WooCommerce HPOS + */ +add_action( + 'before_woocommerce_init', + function () { + if ( class_exists( FeaturesUtil::class) ) { + FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); + } + } +); + // Remove order total from my account orders add_filter('woocommerce_my_account_my_orders_columns', 'remove_my_account_order_total', 10); @@ -34,7 +48,7 @@ function disable_woocommerce_status_remove_dashboard_widgets() { remove_meta_box( 'woocommerce_dashboard_status', 'dashboard', 'normal'); } add_action('wp_dashboard_setup', 'disable_woocommerce_status_remove_dashboard_widgets', 40); - + // Disable reviews dashboard widget function disable_woocommerce_reviews_remove_dashboard_widgets() { remove_meta_box( 'woocommerce_dashboard_recent_reviews', 'dashboard', 'normal'); @@ -42,7 +56,7 @@ function disable_woocommerce_reviews_remove_dashboard_widgets() { add_action('wp_dashboard_setup', 'disable_woocommerce_reviews_remove_dashboard_widgets', 40); // Hide tags, featured and type admin columns from the product list -function unset_some_columns_in_product_list( $column_headers ) { +function unset_some_columns_in_product_list( $column_headers ) { unset($column_headers['product_tag']); unset($column_headers['featured']); unset($column_headers['product_type']);