Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Privacy_Exporters::get_order_data( LLMS_Order $order )

Retrieve export data for a single order


Parameters Parameters

$order

(LLMS_Order) (Required) Order object.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/privacy/class-llms-privacy-exporters.php

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
private static function get_order_data( $order ) {
 
    $data = array();
 
    $props = self::get_order_data_props( 'export' );
 
    foreach ( $props as $prop => $name ) {
 
        $value = apply_filters( 'llms_privacy_export_order_data_prop_value', $order->get( $prop ), $prop, $order );
 
        if ( $value ) {
            $data[] = array(
                'name'  => $name,
                'value' => $value,
            );
        }
    }
 
    $transactions = $order->get_transactions(
        array(
            'per_page' => 500,
        )
    );
    if ( $transactions['transactions'] ) {
        $txns = array();
        foreach ( $transactions['transactions'] as $txn ) {
            $txns[] = sprintf( '%1$s — %2$s (#%3$d)', $txn->get( 'date' ), $txn->get_price( 'amount' ), $txn->get( 'id' ) );
        }
        $data[] = array(
            'name'  => __( 'Transactions', 'lifterlms' ),
            'value' => implode( '<br>', $txns ),
        );
    }
 
    return apply_filters( 'llms_privacy_export_order_data', $data, $order );
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.