WooCommerce Code Reference

WC_Meta_Data
in package
implements JsonSerializable

Meta data class.

Interfaces, Classes and Traits

JsonSerializable

Table of Contents

$current_data  : array
Current data for metadata
$data  : array
Metadata data
__construct()  : mixed
Constructor.
__get()  : mixed
Returns the value of any property.
__isset()  : bool
Checks if a given key exists in our data. This is called internally by `empty` and `isset`.
__set()  : mixed
Creates or updates a property in the metadata object.
apply_changes()  : mixed
Merge changes with data and clear.
get_changes()  : array
Return data changes only.
get_data()  : array
Return all data as an array.
jsonSerialize()  : object|array
When converted to JSON.

Properties

Methods

__construct()

Constructor.

public __construct([array $meta = array() ]) : mixed
Parameters
$meta : array = array()

Data to wrap behind this function.

Return values
mixed

__get()

Returns the value of any property.

public __get(string $key) : mixed
Parameters
$key : string

Key to get.

Return values
mixedProperty value or NULL if it does not exists

__isset()

Checks if a given key exists in our data. This is called internally by `empty` and `isset`.

public __isset(string $key) : bool
Parameters
$key : string

Key to check if set.

Return values
bool

__set()

Creates or updates a property in the metadata object.

public __set(string $key, mixed $value) : mixed
Parameters
$key : string

Key to set.

$value : mixed

Value to set.

Return values
mixed