notifications->countActiveNotifications(); if ( $notifications ) { $count = $notifications < 10 ? $notifications : '!'; $indicator = '
'; } // Add the menu $wp_admin_bar->add_menu( array( 'id' => 'edd-store-menu', 'title' => 'EDD' . $indicator, 'href' => edd_get_admin_url( array( 'page' => 'edd-reports', ) ), ) ); if ( ! empty( $count ) ) { $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-store-notifications', 'title' => __( 'Notifications', 'easy-digital-downloads' ) . ' ', 'href' => edd_get_admin_url( array( 'page' => 'edd-reports', 'notifications' => 'true', ) ), ) ); } $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-store-reports', 'title' => __( 'Store Reports', 'easy-digital-downloads' ), 'href' => edd_get_admin_url( array( 'page' => 'edd-reports', ) ), ) ); $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-store-settings', 'title' => __( 'Store Settings', 'easy-digital-downloads' ), 'href' => edd_get_admin_url( array( 'page' => 'edd-settings', ) ), ) ); $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-store-prodcuts', 'title' => sprintf( __( 'All %1$s', 'easy-digital-downloads' ), edd_get_label_plural() ), 'href' => edd_get_admin_url(), ) ); // String. $text = ! edd_is_test_mode() ? __( 'Live', 'easy-digital-downloads' ) : __( 'Test Mode', 'easy-digital-downloads' ); // Mode. $mode = ! edd_is_test_mode() ? 'live' : 'test'; $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-store-status', 'title' => sprintf( __( 'Store Status: %s', 'easy-digital-downloads' ), '' . $text . '' ), 'href' => edd_get_admin_url( array( 'page' => 'edd-settings', 'tab' => 'gateways', ) ), ) ); $pass_manager = new \EDD\Admin\Pass_Manager(); if ( false === $pass_manager->has_pass() ) { $url = edd_link_helper( 'https://easydigitaldownloads.com/lite-upgrade/', array( 'utm_medium' => 'admin-bar', 'utm_content' => 'upgrade-to-pro', ) ); $wp_admin_bar->add_menu( array( 'parent' => 'edd-store-menu', 'id' => 'edd-upgrade', 'title' => esc_html__( 'Upgrade to Pro', 'easy-digital-downloads' ), 'href' => $url, 'meta' => array( 'target' => '_blank', 'rel' => 'noopener noreferrer', ), ) ); } // Is development environment? $is_dev = edd_is_dev_environment(); if ( ! empty( $is_dev ) ) { $wp_admin_bar->add_menu( array( 'id' => 'edd-is-dev', 'title' => sprintf( __( 'Development Domain %s', 'easy-digital-downloads' ), '' . $is_dev . '' ), 'parent' => 'edd-store-menu', 'href' => edd_get_admin_url( array( 'page' => 'edd-settings', 'tab' => 'gateways', ) ), ) ); } } add_action( 'admin_bar_menu', 'edd_maybe_add_store_mode_admin_bar_menu', 9999 ); /** * Styling for text-mode button * * @since 3.0 */ function edd_store_mode_admin_bar_print_link_styles() { // Bail if user cannot manage shop settings if ( ! current_user_can( 'manage_shop_settings' ) ) { return; } ?>