PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/admin/views/dashboard/html-orders.php +16 -22 4.1.7.34.4.8 View file →
@@ -1,54 +1,48 @@
1 1 <?php
2 2 /**
3 - * Template for displaying orders dashboard in wp-admin
3 + * Template for displaying statistic orders dashboard in wp-admin
4 4 *
5 5 * @author ThimPress
6 6 * @package LearnPress/Inc/Admin/Views/
7 - * @version 4.0.0
7 + * @version 4.0.1
8 8 */
9 9
10 10 defined( 'ABSPATH' ) || exit;
11 11
12 -if ( empty( $specific_statuses ) ) {
12 +if ( ! isset( $order_statuses ) || ! isset( $lp_order_icons ) ) {
13 13 return;
14 14 }
15 15 ?>
16 16
17 17 <li class="count-number total-raised">
18 - <strong><?php echo learn_press_get_total_price_order_complete(); ?></strong>
18 + <span>
19 + <i class="dashicons dashicons-chart-bar"></i>
20 + <?php echo learn_press_get_total_price_order_complete(); ?></span>
19 21 <p><?php esc_html_e( 'Total Raised', 'learnpress' ); ?></p>
20 22 </li>
21 23
22 24 <?php
23 -
24 -$counts = learn_press_count_orders( array( 'status' => $specific_statuses ) );
25 -
26 -foreach ( $specific_statuses as $status ) :
27 -
28 - $status_object = get_post_status_object( $status );
29 -
30 - if ( ! $status_object ) {
31 - continue;
32 - }
33 -
34 - $count = $counts[ $status ];
35 - $url = $count ? admin_url( 'edit.php?post_type=' . LP_ORDER_CPT . '&post_status=' . $status ) : '#';
25 +$counts = learn_press_count_orders();
26 +foreach ( $order_statuses as $key => $status ) :
27 + $count = $counts[ $key ];
28 + $url = $count ? admin_url( 'edit.php?post_type=' . LP_ORDER_CPT . '&post_status=' . $key ) : '#';
36 29 ?>
37 30
38 - <li class="counter-number order-<?php echo str_replace( 'lp-', '', $status ); ?>">
31 + <li class="counter-number order-<?php echo $status; ?>">
39 32 <div class="counter-inner">
40 33 <a href="<?php echo esc_url_raw( $url ); ?>">
41 - <strong>
34 + <span>
42 35 <?php
43 36 if ( $count ) {
44 - printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count );
37 + printf( translate_nooped_plural( _n_noop( '%d order', '%d orders', 'learnpress' ), $count, 'learnpress' ), $count );
45 38 } else {
46 39 printf( __( '%d order', 'learnpress' ), 0 );
47 40 }
41 + //echo $lp_order_icons[ $status ];
48 42 ?>
49 - </strong>
50 - <p><?php printf( '%s', $status_object->label ); ?></p>
43 + </span>
44 + <p><?php printf( '%s', LP_Order::get_status_label( $status ) ); ?></p>
51 45 </a>
52 46 </div>
53 47 </li>
54 48 <?php endforeach; ?>