LLMS_Admin_Post_Table_Orders::manage_columns( string $column, int $post_id )
Order post: Queries data based on column name.
Description Description
Parameters Parameters
- $column
-
(string) (Required) custom column name
- $post_id
-
(int) (Required) ID of the individual post
Return Return
(void)
Source Source
File: includes/admin/post-types/post-tables/class.llms.admin.post.table.orders.php
public function manage_columns( $column, $post_id ) { global $post; $order = new LLMS_Order( $post_id ); switch ( $column ) { case 'order' : echo '<a href="' . admin_url( 'post.php?post=' . $post_id . '&action=edit' ) . '">'; printf( _x( '#%d', 'order number display', 'lifterlms' ), $post_id ); echo '</a> '; _e( 'by', 'lifterlms' ); echo ' '; if ( 'yes' === $order->get( 'anonymized' ) ) { echo $order->get_customer_name(); } else { echo '<a href="' . get_edit_user_link( $order->get( 'user_id' ) ) . '">' . $order->get_customer_name() . '</a><br>'; echo '<a href="mailto:' . $order->get( 'billing_email' ) . '">' . $order->get( 'billing_email' ) . '</a>'; } break; case 'payment_status' : $status = $order->get( 'status' ); echo '<span class="llms-status llms-size--large ' . $status . ' ">' . llms_get_order_status_name( $status ) . '</span>'; break; case 'access_status': $date = $order->get_access_expiration_date( 'F j, Y' ); $ts = strtotime( $date ); // timestamp will be false if date is not a date if ( $ts ) { if ( $ts < current_time( 'timestamp' ) ) { _ex( 'Expired:', 'access plan expiration', 'lifterlms' ); } else { _ex( 'Expires:', 'access plan expiration', 'lifterlms' ); } echo ' ' . $date; } // End if(). else { echo $date; } break; case 'product' : echo '<a href="' . admin_url( 'post.php?post=' . $order->get( 'product_id' ) . '&action=edit' ) . '">' . $order->get( 'product_title' ) . '</a>'; echo ' (' . ucfirst( $order->get( 'product_type' ) ) . ')'; break; case 'revenue' : $grosse = $order->get_revenue( 'grosse' ); $net = $order->get_revenue( 'net' ); if ( $grosse !== $net ) { echo '<del>' . llms_price( $grosse ) . '</del> '; } echo llms_price( $net ); break; case 'type': if ( $order->is_recurring() ) { _e( 'Recurring', 'lifterlms' ); } else { _e( 'One-time', 'lifterlms' ); } break; case 'order_date' : echo $order->get_date( 'date' ); break; }// End switch(). }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: