Last active
November 2, 2015 18:50
-
-
Save SeanTOSCD/91a4c7127bdb5fe50596 to your computer and use it in GitHub Desktop.
Custom FES Dashboard Tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // DON'T COPY THIS LINE | |
if ( class_exists( 'EDD_Front_End_Submissions' ) ) { | |
function custom_vendor_dashboard_menu() { | |
$menu_items = array(); | |
// Dashboard tab | |
$menu_items['home'] = array( | |
"icon" => "home", | |
"task" => array( 'dashboard', '' ), | |
"name" => __( 'Dashboard', 'edd_fes' ), | |
); | |
// "Products" tab | |
$menu_items['my_products'] = array( | |
"icon" => "list", | |
"task" => array( 'products' ), | |
"name" => EDD_FES()->vendors->get_product_constant_name( $plural = true, $uppercase = true ), | |
); | |
// Add "Product" tab | |
if ( EDD_FES()->vendors->vendor_can_create_product() ) { | |
$menu_items['new_product'] = array( | |
"icon" => "pencil", | |
"task" => array( 'new-product' ), | |
"name" => __( 'Add', 'edd_fes' ) . ' ' . EDD_FES()->vendors->get_product_constant_name( $plural = false, $uppercase = true ), | |
); | |
} | |
// Earnings tab | |
if ( EDD_FES()->integrations->is_commissions_active() ) { | |
$menu_items['earnings'] = array( | |
"icon" => "shopping-cart", | |
"task" => array( 'earnings' ), | |
"name" => __( 'Earnings', 'edd_fes' ), | |
); | |
} | |
// Orders tab | |
if ( EDD_FES()->vendors->vendor_can_view_orders() ){ | |
$menu_items['orders'] = array( | |
"icon" => "gift", | |
"task" => array( 'orders' ), | |
"name" => __( 'Orders', 'edd_fes' ), | |
); | |
} | |
// Profile tab | |
$menu_items['profile'] = array( | |
"icon" => "user", | |
"task" => array( 'profile' ), | |
"name" => __( 'Profile', 'edd_fes' ), | |
); | |
// Logout tab | |
$menu_items['logout'] = array( | |
"icon" => "off", | |
"task" => array( 'logout' ), | |
"name" => __( 'Logout', 'edd_fes' ), | |
); | |
return $menu_items; | |
} | |
} | |
add_filter( 'fes_vendor_dashboard_menu', 'custom_vendor_dashboard_menu' ); |
how can I change the text 'Create New Product'??please tell me ..
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this Gist!
Now digging how to add content to our new tab.