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

Check for wc-blocks script registration before checking payment method script dependencies #8428

Merged
merged 3 commits into from
Feb 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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