payment_method_settings_validation_{$method}

Description  #

This filter is used during saving any payment method to validate the data.

apply_filters('payment_method_settings_validation_' . $method, $errors, $settings);

Usage   #

add_filter('payment_method_settings_validation_'.$method, function ($errors, $settings) {
    // validate here
    return $errors
}, 10, 2);

Parameters #

  • $errors (array) Validation Errors
  • $settings (array) Payment Settings

Placement #

This code should be placed in the functions.php file of your active theme.

Source Code #

This filter is located in the pro version src/Payments/AjaxEndpoints.php

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *