mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Set $_POST before validation
This commit is contained in:
parent
e5cced2008
commit
308ce11674
1 changed files with 4 additions and 3 deletions
|
@ -27,9 +27,10 @@ class CheckoutFormValidator extends WC_Checkout {
|
|||
public function validate( array $data ) {
|
||||
$errors = new WP_Error();
|
||||
|
||||
if ( isset( $data['terms-field'] ) ) {
|
||||
// WC checks this field via $_POST https://github.com/woocommerce/woocommerce/issues/35328 .
|
||||
$_POST['terms-field'] = $data['terms-field'];
|
||||
// Some plugins check their fields using $_POST,
|
||||
// also WC terms checkbox https://github.com/woocommerce/woocommerce/issues/35328 .
|
||||
foreach ( $data as $key => $value ) {
|
||||
$_POST[ $key ] = $value;
|
||||
}
|
||||
|
||||
// It throws some notices when checking fields etc., also from other plugins via hooks.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue