Remove constants and unhook old blocks plugin (https://github.com/woocommerce/woocommerce-blocks/pull/757)
This commit is contained in:
parent
d8b459b312
commit
eb4b8f426e
|
@ -158,9 +158,9 @@ class Assets {
|
||||||
protected static function get_file_version( $file ) {
|
protected static function get_file_version( $file ) {
|
||||||
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
||||||
$file = trim( $file, '/' );
|
$file = trim( $file, '/' );
|
||||||
return filemtime( WGPB_ABSPATH . $file );
|
return filemtime( \Automattic\WooCommerce\Blocks\Package::get_path() . '/' . $file );
|
||||||
}
|
}
|
||||||
return WGPB_VERSION;
|
return \Automattic\WooCommerce\Blocks\Package::get_version();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,14 +35,14 @@ class Package {
|
||||||
if ( true === self::$did_init || ! self::has_dependencies() ) {
|
if ( true === self::$did_init || ! self::has_dependencies() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$did_init = true;
|
self::$did_init = true;
|
||||||
|
self::remove_core_blocks();
|
||||||
|
|
||||||
if ( ! self::is_built() ) {
|
if ( ! self::is_built() ) {
|
||||||
return self::add_build_notice();
|
return self::add_build_notice();
|
||||||
}
|
}
|
||||||
|
|
||||||
self::define_constants();
|
|
||||||
self::remove_core_blocks();
|
|
||||||
Library::init();
|
Library::init();
|
||||||
Assets::init();
|
Assets::init();
|
||||||
RestApi::init();
|
RestApi::init();
|
||||||
|
@ -104,14 +104,6 @@ class Package {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Define plugin constants.
|
|
||||||
*/
|
|
||||||
protected static function define_constants() {
|
|
||||||
define( 'WGPB_VERSION', self::VERSION );
|
|
||||||
define( 'WGPB_ABSPATH', self::get_path() . '/' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove core blocks (for 3.6 and below).
|
* Remove core blocks (for 3.6 and below).
|
||||||
*/
|
*/
|
||||||
|
@ -121,6 +113,7 @@ class Package {
|
||||||
remove_action( 'init', array( 'WC_Block_Library', 'register_assets' ) );
|
remove_action( 'init', array( 'WC_Block_Library', 'register_assets' ) );
|
||||||
remove_filter( 'block_categories', array( 'WC_Block_Library', 'add_block_category' ) );
|
remove_filter( 'block_categories', array( 'WC_Block_Library', 'add_block_category' ) );
|
||||||
remove_action( 'admin_print_footer_scripts', array( 'WC_Block_Library', 'print_script_settings' ), 1 );
|
remove_action( 'admin_print_footer_scripts', array( 'WC_Block_Library', 'print_script_settings' ), 1 );
|
||||||
|
remove_action( 'init', array( 'WGPB_Block_Library', 'init' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue