includes/abstracts/abstract-wc-data.php 1 location
|
@@ 413-415 (lines=3) @@
|
| 410 |
|
foreach ( $props as $prop => $value ) { |
| 411 |
|
try { |
| 412 |
|
$setter = "set_$prop"; |
| 413 |
|
if ( ! is_null( $value ) && is_callable( array( $this, $setter ) ) ) { |
| 414 |
|
$this->{$setter}( wc_clean( wp_unslash( $value ) ) ); |
| 415 |
|
} |
| 416 |
|
} catch ( WC_Data_Exception $e ) { |
| 417 |
|
$errors->add( $e->getErrorCode(), $e->getMessage() ); |
| 418 |
|
} |
includes/admin/wc-admin-functions.php 1 location
|
@@ 262-264 (lines=3) @@
|
| 259 |
|
foreach ( $set_data as $prop => $value ) { |
| 260 |
|
try { |
| 261 |
|
$setter = "set_$prop"; |
| 262 |
|
if ( is_callable( array( $item, $setter ) ) ) { |
| 263 |
|
$item->{$setter}( wc_clean( wp_unslash( $value ) ) ); |
| 264 |
|
} |
| 265 |
|
} catch ( WC_Data_Exception $e ) { |
| 266 |
|
unset( $e ); // Skip prop and leave set to default |
| 267 |
|
} |