Revert rendering of GooglePay button to wp action.

This commit is contained in:
Pedro Silva 2023-10-26 12:18:07 +01:00
parent 46b47dc97b
commit 4fbc47f1cf
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 10 additions and 4 deletions

View file

@ -76,9 +76,15 @@ class GooglepayModule implements ModuleInterface {
}
// Initializes button rendering.
if ( ! is_admin() ) {
$button->render();
}
add_action(
'wp',
static function () use ( $c, $button ) {
if ( is_admin() ) {
return;
}
$button->render();
}
);
// Enqueue frontend scripts.
add_action(