PHP Class WC_Order_Item_Meta

A Simple class for managing order item meta so plugins add it in the correct format
Author: WooThemes
Exibir arquivo Open project: woocommerce/woocommerce Class Usage Examples

Public Properties

Property Type Description
$meta Post meta data
$product object

Public Methods

Method Description
__construct ( array $item = [], WC_Product $product = null ) Constructor.
display ( boolean $flat = false, boolean $return = false, string $hideprefix = '_', string $delimiter = ", " ) : string | void Display meta in a formatted list.
get_formatted ( string $hideprefix = '_' ) : array Return an array of formatted item meta in format e.g.
get_formatted_legacy ( $hideprefix = '_' ) : array Return an array of formatted item meta in format e.g.

Method Details

__construct() public method

Constructor.
public __construct ( array $item = [], WC_Product $product = null )
$item array defaults to array()
$product WC_Product defaults to null

display() public method

Display meta in a formatted list.
public display ( boolean $flat = false, boolean $return = false, string $hideprefix = '_', string $delimiter = ", " ) : string | void
$flat boolean (default: false)
$return boolean (default: false)
$hideprefix string (default: _)
$delimiter string Delimiter used to separate items when $flat is true
return string | void

get_formatted() public method

array( 'pa_size' => array( 'label' => 'Size', 'value' => 'Medium', ) )
Since: 2.4
public get_formatted ( string $hideprefix = '_' ) : array
$hideprefix string exclude meta when key is prefixed with this, defaults to `_`
return array

get_formatted_legacy() public method

Handles @deprecated args.
public get_formatted_legacy ( $hideprefix = '_' ) : array
return array

Property Details

$meta public_oe property

Post meta data
public $meta

$product public_oe property

object
public $product