Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 8d86284

Browse files
committed
Fix conflict with hooks + 3.6, pre 3.6.2
1 parent e8bedde commit 8d86284

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

woocommerce-gutenberg-products-block.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ function wgpb_initialize() {
2727

2828
// Remove core hook in favor of our local feature plugin handler.
2929
remove_action( 'init', array( 'WC_Block_Library', 'init' ) );
30+
// Remove core hooks from pre-3.6 (in 3.6.2 all functions were moved to one hook on init).
31+
remove_action( 'init', array( 'WC_Block_Library', 'register_blocks' ) );
32+
remove_action( 'init', array( 'WC_Block_Library', 'register_assets' ) );
33+
remove_filter( 'block_categories', array( 'WC_Block_Library', 'add_block_category' ) );
34+
remove_action( 'admin_print_footer_scripts', array( 'WC_Block_Library', 'print_script_settings' ), 1 );
3035

3136
$files_exist = file_exists( plugin_dir_path( __FILE__ ) . '/build/featured-product.js' );
3237
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && ! $files_exist ) {

0 commit comments

Comments
 (0)