Skip to content

Commit

Permalink
feat: HPOS compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dkjensen committed Nov 7, 2023
1 parent 1f320be commit f7c62d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== WooCommerce Cart PDF ===
Contributors: cloudcatch, dkjensen, seattlewebco, davidperez, exstheme
Tested up to: 6.3
Tested up to: 6.4
Requires PHP: 5.6.0
Stable tag: 0.0.0-development
Requires at least: 5.0
Expand Down Expand Up @@ -28,6 +28,12 @@ Adds ability for users and guests to download their WooCommerce cart as PDF. Use

== Changelog ==

2.6.0
* HPOS (high performance order storage) compatibility

2.5.0
* TranslatePress compatibility

2.4.0
* Update broken image compatibility
* Add debug capability using constant `define( 'WC_CART_PDF_DEBUG', true );` to **wp-config.php**
Expand Down
14 changes: 13 additions & 1 deletion wc-cart-pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Domain Path: /languages/
* Contributors: cloudcatch, dkjensen, seattlewebco, davidperez, exstheme
* Requires PHP: 5.6.0
* WC tested up to: 7.9.0
* WC tested up to: 8.2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -436,3 +436,15 @@ function wc_cart_pdf_customize_register( $wp_customize ) {
);
}
add_action( 'customize_register', 'wc_cart_pdf_customize_register' );

/**
* Declare compatibility with HPOS.
*/
add_action(
'before_woocommerce_init',
function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
}
);

0 comments on commit f7c62d8

Please sign in to comment.