LLMS_Admin_Post_Table_Orders::manage_columns( string $column, int $post_id )
Order post: Queries data based on column name.
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
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | 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 ( llms_parse_bool( $order ->get( 'anonymized' ) ) || empty ( llms_get_student( $order ->get( 'user_id' ) ) ) ) { echo $order ->get_customer_name(); } else { $edit_user_link = $order ->get( 'user_id' ) ? get_edit_user_link( $order ->get( 'user_id' ) ) : '' ; echo ! $edit_user_link ? $order ->get_customer_name() . '<br>' : '<a href="' . $edit_user_link . '">' . $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 ; } else { echo $date ; } break ; case 'product' : if ( llms_get_post( $order ->get( 'product_id' ) ) ) { echo '<a href="' . get_edit_post_link( $order ->get( 'product_id' ) ) . '">' . $order ->get( 'product_title' ) . '</a>' ; } else { echo __( '[DELETED]' , 'lifterlms' ) . ' ' . $order ->get( 'product_title' ); } 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 |
---|---|
7.0.0 | Treat the case when the order has no WordPress user associated yet. |
5.4.0 | Inform about deleted products. |
3.19.0 | Unknown. |
3.0.0 | Introduced. |