PluginProbe
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More / 2.2.0
StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More v2.2.0
2.3.0 2.2.0 2.1.1 2.1.0 2.0.0 1.10.0 1.9.1 1.9.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 All 59 releases
storeengine / includes / miscellaneous.php

miscellaneous.php in StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates & More 2.2.0, at includes/miscellaneous.php

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace StoreEngine;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 use StoreEngine\Utils\Helper;
9
10 class Miscellaneous {
11 public static function init() {
12 $self = new self();
13 add_action( 'admin_bar_menu', array( $self, 'add_admin_bar_menu' ), 90 );
14 }
15 public function add_admin_bar_menu( $wp_admin_bar ) {
16 $dashboard_page_id = (int) Helper::get_settings( 'dashboard_page' );
17 $title = ( current_user_can( 'storeengine_shop_manager' ) ? esc_html__( 'Store Dashboard', 'storeengine' ) : esc_html__( 'Customer Dashboard', 'storeengine' ) );
18 if ( $dashboard_page_id ) {
19 $wp_admin_bar->add_node(
20 array(
21 'id' => 'storeenginedashboard',
22 'title' => $title,
23 'href' => get_the_permalink( $dashboard_page_id ),
24 'parent' => 'site-name',
25 )
26 );
27 }
28
29 if ( is_singular( Helper::PRODUCT_POST_TYPE ) && current_user_can( 'storeengine_shop_manager' ) ) {
30 $wp_admin_bar->add_menu(
31 array(
32 'id' => 'storeengineproducts',
33 'title' => esc_html__( 'Edit Product', 'storeengine' ),
34 'href' => esc_url( admin_url( 'admin.php?page=storeengine-products&id=' . get_the_ID() . '&action=edit' ) ),
35 )
36 );
37 }
38 }
39 }
40