Skip to content

Commit

Permalink
Merge pull request generoi#31 from johanmolen/patch-1
Browse files Browse the repository at this point in the history
Fix potential nested after_setup_theme call
  • Loading branch information
oxyc committed Mar 18, 2024
2 parents a1e1adc + fa2848c commit 8273396
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/WooCommerceServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public function bindFilters()

public function bindSetupAction()
{
add_action('after_setup_theme', [$this->app['woocommerce'], 'addThemeSupport']);
if (doing_action('after_setup_theme')) {
$this->app['woocommerce']->addThemeSupport();
} else {
add_action('after_setup_theme', [$this->app['woocommerce'], 'addThemeSupport']);
}
}
}

0 comments on commit 8273396

Please sign in to comment.