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

Commit

Permalink
Check for wc-blocks before checking payment dependencies (#8428)
Browse files Browse the repository at this point in the history
  • Loading branch information
opr authored Feb 17, 2023
1 parent 73e8437 commit 9f04f9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Payments/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ public function register_payment_method_integrations( PaymentMethodRegistry $pay
* an error in the admin.
*/
public function verify_payment_methods_dependencies() {
// Check that the wc-blocks script is registered before continuing. Some extensions may cause this function to run
// before the payment method scripts' dependencies are registered.
if ( ! wp_script_is( 'wc-blocks', 'registered' ) ) {
return;
}
$wp_scripts = wp_scripts();
$payment_method_scripts = $this->payment_method_registry->get_all_active_payment_method_script_dependencies();

Expand Down

0 comments on commit 9f04f9f

Please sign in to comment.