mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
✨ Pass prop-name to the REST-sanitizer callback
This commit is contained in:
parent
451b45bc10
commit
63eb577126
1 changed files with 2 additions and 2 deletions
|
@ -112,9 +112,9 @@ abstract class RestEndpoint extends WC_REST_Controller {
|
|||
if ( null === $sanitation_cb ) {
|
||||
$sanitized[ $key ] = $value;
|
||||
} elseif ( is_string( $sanitation_cb ) && method_exists( $this, $sanitation_cb ) ) {
|
||||
$sanitized[ $key ] = $this->{$sanitation_cb}( $value );
|
||||
$sanitized[ $key ] = $this->{$sanitation_cb}( $value, $key );
|
||||
} elseif ( is_callable( $sanitation_cb ) ) {
|
||||
$sanitized[ $key ] = $sanitation_cb( $value );
|
||||
$sanitized[ $key ] = $sanitation_cb( $value, $key );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue