WooCommerce::__set
Set the value of an inaccessible or non-existing property.
Метод класса: WooCommerce{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WooCommerce = new WooCommerce(); $WooCommerce->__set( $key, $value );
- $key(строка) (обязательный)
- Property name.
- $value(разное) (обязательный)
- Property value.
Код WooCommerce::__set() WooCommerce:: set WC 10.7.0
public function __set( string $key, $value ) {
if ( 'api' === $key ) {
$this->api = $value;
} elseif ( property_exists( $this, $key ) ) {
throw new Exception( 'Cannot access private property ' . __CLASS__ . '::$' . esc_html( $key ) );
} else {
$this->$key = $value;
}
}