Skip to content

added hpos support #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
composer.lock
20 changes: 17 additions & 3 deletions wc-performance-improvements.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -34,15 +48,15 @@ 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');
}
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']);
Expand Down