Warn users of shipping rates to test for existence of meta_data correctly.
As per the info in the issue itself, using `isset()` gives incorrect result all the time, so warn developers about the problem.
This commit is contained in:
parent
3611d46437
commit
4ea28030f2
|
@ -65,6 +65,9 @@ class WC_Shipping_Rate {
|
|||
* @return bool
|
||||
*/
|
||||
public function __isset( $key ) {
|
||||
if ( 'meta_data' === $key ) {
|
||||
wc_doing_it_wrong( __FUNCTION__, __( 'Use `array_key_exists` to check for meta_data on Shipping rates to get the correct result.', 'woocommerce' ), '6.0' );
|
||||
}
|
||||
return isset( $this->data[ $key ] );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue