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

Commit

Permalink
Merge branch 'trunk' into poc/cart_and_checkout_fse_templates
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Domain/Bootstrap.php
  • Loading branch information
wavvves committed Mar 7, 2023
2 parents 4872faf + 9ab8f48 commit 4ed6507
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/Domain/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
use Automattic\WooCommerce\Blocks\Registry\Container;
use Automattic\WooCommerce\Blocks\Shipping\ShippingController;
use Automattic\WooCommerce\Blocks\Templates\BlockTemplatesCompatibility;
use Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplatesCompatibility;
use Automattic\WooCommerce\Blocks\Templates\CartTemplate;
use Automattic\WooCommerce\Blocks\Templates\CheckoutTemplate;
use Automattic\WooCommerce\Blocks\Templates\ClassicTemplatesCompatibility;
use Automattic\WooCommerce\Blocks\Templates\ProductAttributeTemplate;
use Automattic\WooCommerce\Blocks\Templates\ProductSearchResultsTemplate;
use Automattic\WooCommerce\Blocks\Templates\SingleProductTemplateCompatibility;
use Automattic\WooCommerce\StoreApi\RoutesController;
use Automattic\WooCommerce\StoreApi\SchemaController;
use Automattic\WooCommerce\StoreApi\StoreApi;
Expand Down Expand Up @@ -82,6 +83,8 @@ public function __construct( Container $container ) {
* To ensure blocks are initialized, you must use the `woocommerce_blocks_loaded`
* hook instead of the `plugins_loaded` hook. This is because the functions
* hooked into plugins_loaded on the same priority load in an inconsistent and unpredictable manner.
*
* @since 2.5.0
*/
do_action( 'woocommerce_blocks_loaded' );
}
Expand Down Expand Up @@ -132,7 +135,8 @@ function() {
$this->container->get( CartTemplate::class );
$this->container->get( CheckoutTemplate::class );
$this->container->get( ClassicTemplatesCompatibility::class );
$this->container->get( BlockTemplatesCompatibility::class );
$this->container->get( ArchiveProductTemplatesCompatibility::class )->init();
$this->container->get( SingleProductTemplateCompatibility::class )->init();
$this->container->get( BlockPatterns::class );
$this->container->get( PaymentsApi::class );
$this->container->get( ShippingController::class )->init();
Expand Down Expand Up @@ -291,9 +295,16 @@ function ( Container $container ) {
}
);
$this->container->register(
BlockTemplatesCompatibility::class,
ArchiveProductTemplatesCompatibility::class,
function () {
return new BlockTemplatesCompatibility();
return new ArchiveProductTemplatesCompatibility();
}
);

$this->container->register(
SingleProductTemplateCompatibility::class,
function () {
return new SingleProductTemplateCompatibility();
}
);
$this->container->register(
Expand Down Expand Up @@ -402,7 +413,11 @@ protected function deprecated_dependency( $function, $version, $replacement = ''
$function,
$version
);

/**
* Fires when a deprecated function is called.
*
* @since 7.3.0
*/
do_action( 'deprecated_function_run', $function, $replacement, $version );

$log_error = false;
Expand All @@ -417,7 +432,13 @@ protected function deprecated_dependency( $function, $version, $replacement = ''
$log_error = true;
}

// Apply same filter as WP core.
/**
* Filters whether to trigger an error for deprecated functions. (Same as WP core)
*
* @since 7.3.0
*
* @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
*/
if ( ! apply_filters( 'deprecated_function_trigger_error', true ) ) {
$log_error = true;
}
Expand Down

0 comments on commit 4ed6507

Please sign in to comment.