You appear to be a bot. Output may be restricted
Description
Get a post meta item for the payment
Usage
$mixed = EDD_Payment::get_meta( $meta_key, $single );
Parameters
- $meta_key
- ( string ) optional default: _edd_payment_meta – The Meta Key
- $single
- ( boolean ) optional default: 1 – Return single item or array
Returns
mixed The value from the post meta
Source
File name: easy-digital-downloads/includes/payments/class-edd-payment.php
Lines:
1 to 47 of 47
public function get_meta( $meta_key = '_edd_payment_meta', $single = true ) { $meta = get_post_meta( $this->ID, $meta_key, $single ); if ( $meta_key === '_edd_payment_meta' ) { if ( empty( $meta ) ) { $meta = array(); } // #5228 Fix possible data issue introduced in 2.6.12 if ( is_array( $meta ) && isset( $meta[0] ) ) { $bad_meta = $meta[0]; unset( $meta[0] ); if ( is_array( $bad_meta ) ) { $meta = array_merge( $meta, $bad_meta ); } update_post_meta( $this->ID, '_edd_payment_meta', $meta ); } // Payment meta was simplified in EDD v1.5, so these are here for backwards compatibility if ( empty( $meta['key'] ) ) { $meta['key'] = $this->setup_payment_key(); } if ( empty( $meta['email'] ) ) { $meta['email'] = $this->setup_email(); } if ( empty( $meta['date'] ) ) { $meta['date'] = get_post_field( 'post_date', $this->ID ); } } $meta = apply_filters( 'edd_get_payment_meta_' . $meta_key, $meta, $this->ID ); if ( is_serialized( $meta ) ) { preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $meta, $matches ); if ( ! empty( $matches ) ) { $meta = array(); } } return apply_filters( 'edd_get_payment_meta', $meta, $this->ID, $meta_key ); }