PluginProbe
Tutor LMS – eLearning and online course solution / 3.7.2
Tutor LMS – eLearning and online course solution v3.7.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
← All changes | ecommerce/AdminMenu.php +6 -28 trunk3.7.2 View file →
@@ -20,22 +20,17 @@
20 20 /**
21 21 * Constructor
22 22 */
23 23 public function __construct() {
24 - add_filter( 'tutor_admin_menu', array( $this, 'register_menu' ) );
24 + add_action( 'tutor_after_courses_admin_menu', array( $this, 'register_menu' ) );
25 25 }
26 26
27 27 /**
28 28 * Register menu
29 29 *
30 - * @since 3.0.0
31 - * @since 3.8.0 param menu added.
32 - *
33 - * @param array $menu menu.
34 - *
35 - * @return array
30 + * @return void
36 31 */
37 - public function register_menu( $menu ) {
32 + public function register_menu() {
38 33 $order_menu_title = __( 'Orders', 'tutor' );
39 34 $order_badge_count = get_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT );
40 35
41 36 if ( false === $order_badge_count ) {
@@ -42,9 +37,8 @@
42 37 $order_badge_count = ( new OrderModel() )->get_order_count(
43 38 array(
44 39 'payment_status' => OrderModel::PAYMENT_UNPAID,
45 40 'order_type' => OrderModel::TYPE_SINGLE_ORDER,
46 - 'order_status' => OrderModel::ORDER_INCOMPLETE,
47 41 )
48 42 );
49 43 set_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT, $order_badge_count, HOUR_IN_SECONDS );
50 44 }
@@ -52,27 +46,11 @@
52 46 if ( $order_badge_count ) {
53 47 $order_menu_title .= ' <span class="update-plugins"><span class="plugin-count">' . $order_badge_count . '</span></span>';
54 48 }
55 49
56 - $menu['group_two']['orders'] = array(
57 - 'parent_slug' => 'tutor',
58 - 'page_title' => __( 'Orders', 'tutor' ),
59 - 'menu_title' => $order_menu_title,
60 - 'capability' => 'manage_options',
61 - 'menu_slug' => OrderController::PAGE_SLUG,
62 - 'callback' => array( $this, 'orders_view' ),
63 - );
64 -
65 - $menu['group_two']['coupons'] = array(
66 - 'parent_slug' => 'tutor',
67 - 'page_title' => __( 'Coupons', 'tutor' ),
68 - 'menu_title' => __( 'Coupons', 'tutor' ),
69 - 'capability' => 'manage_options',
70 - 'menu_slug' => CouponController::PAGE_SLUG,
71 - 'callback' => array( $this, 'coupons_view' ),
72 - );
73 -
74 - return $menu;
50 + add_submenu_page( 'tutor', __( 'Orders', 'tutor' ), $order_menu_title, 'manage_options', OrderController::PAGE_SLUG, array( $this, 'orders_view' ) );
51 + do_action( 'tutor_after_orders_admin_menu' );
52 + add_submenu_page( 'tutor', __( 'Coupons', 'tutor' ), __( 'Coupons', 'tutor' ), 'manage_options', CouponController::PAGE_SLUG, array( $this, 'coupons_view' ) );
75 53 }
76 54
77 55 /**
78 56 * Orders view page