Skip to content

Commit

Permalink
🐛 fix(dokan.php): rename add_hpos_support() to declare_woocommerce_fe…
Browse files Browse the repository at this point in the history
…ature_compatibility() for better clarity and semantics

✨ feat(dokan.php): add declaration of compatibility for 'cart_checkout_blocks' feature in WooCommerce to improve compatibility with newer versions
  • Loading branch information
nurul-umbhiya committed Nov 28, 2023
1 parent 86c55f4 commit a882f43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private function __construct() {
register_activation_hook( __FILE__, [ $this, 'activate' ] );
register_deactivation_hook( __FILE__, [ $this, 'deactivate' ] );

add_action( 'before_woocommerce_init', [ $this, 'add_hpos_support' ] );
add_action( 'before_woocommerce_init', [ $this, 'declare_woocommerce_feature_compatibility' ] );
add_action( 'woocommerce_loaded', [ $this, 'init_plugin' ] );
add_action( 'woocommerce_flush_rewrite_rules', [ $this, 'flush_rewrite_rules' ] );

Expand Down Expand Up @@ -287,9 +287,10 @@ private function define( $name, $value ) {
*
* @return void
*/
public function add_hpos_support() {
public function declare_woocommerce_feature_compatibility() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, false );
}
}

Expand Down

0 comments on commit a882f43

Please sign in to comment.