WooCommerce Code Reference

Search results

WC_Meta_Data implements JsonSerializable

Meta data class.

Table of Contents

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

Properties

Methods

__construct()

Constructor.

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

Data to wrap behind this function.

Return values
mixed

jsonSerialize()

When converted to JSON.

public jsonSerialize( ) : object|array
Return values
object|array

apply_changes()

Merge changes with data and clear.

public apply_changes( ) : mixed
Return values
mixed

__set()

Creates or updates a property in the metadata object.

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

Key to set.

$value : mixed

Value to set.

Return values
mixed

__isset()

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

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

Key to check if set.

Return values
bool

__get()

Returns the value of any property.

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

Key to get.

Return values
mixed

Property value or NULL if it does not exists

get_changes()

Return data changes only.

public get_changes( ) : array
Return values
array

get_data()

Return all data as an array.

public get_data( ) : array
Return values
array
Back to the top