PHP Class WC_Order_Item_Meta

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

Méthodes publiques

Свойство Type Description
$meta Post meta data
$product object

Méthodes publiques

Méthode 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 méthode

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

display() public méthode

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
Résultat string | void

get_formatted() public méthode

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 `_`
Résultat array

get_formatted_legacy() public méthode

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

Property Details

$meta public_oe property

Post meta data
public $meta

$product public_oe property

object
public $product