Updates to 7.9.0

This commit is contained in:
WooCommerce
2025-09-18 10:16:37 +00:00
parent 7d081fb691
commit 708a1fa4a4
53 changed files with 1174 additions and 401 deletions

View File

@@ -22,17 +22,15 @@ class WCS_Blocks_Integration implements IntegrationInterface {
*/
public function initialize() {
$script_path = 'build/index.js';
$style_path = 'build/index.css';
$script_url = \WC_Subscriptions_Core_Plugin::instance()->get_subscriptions_core_directory_url( $script_path );
$style_url = \WC_Subscriptions_Core_Plugin::instance()->get_subscriptions_core_directory_url( $style_path );
$script_asset_path = \WC_Subscriptions_Plugin::instance()->get_plugin_directory( 'build/index.asset.php' );
$script_asset = file_exists( $script_asset_path )
? require $script_asset_path
: array(
'dependencies' => array(),
'version' => $this->get_file_version( $script_asset_path ),
'version' => self::get_file_version( $script_asset_path ),
);
wp_register_script(
@@ -47,13 +45,6 @@ class WCS_Blocks_Integration implements IntegrationInterface {
'woocommerce-subscriptions',
\WC_Subscriptions_Plugin::instance()->get_plugin_directory( 'languages' )
);
wp_enqueue_style(
'wc-blocks-integration',
$style_url,
'',
$this->get_file_version( \WC_Subscriptions_Plugin::instance()->get_plugin_directory( 'build/index.css' ) ),
'all'
);
}
/**
@@ -92,7 +83,7 @@ class WCS_Blocks_Integration implements IntegrationInterface {
* @param string $file Local path to the file.
* @return string The cache buster value to use for the given file.
*/
protected function get_file_version( $file ) {
public static function get_file_version( $file ) {
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( $file ) ) {
return filemtime( $file );
}