Skip to content

Instantly share code, notes, and snippets.

@SeanTOSCD
Last active November 2, 2015 18:50
Show Gist options
  • Save SeanTOSCD/91a4c7127bdb5fe50596 to your computer and use it in GitHub Desktop.
Save SeanTOSCD/91a4c7127bdb5fe50596 to your computer and use it in GitHub Desktop.
Custom FES Dashboard Tabs
<?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' );
@tinyamasisurum0
Copy link

Big thanks for this gist, really happy to see that.
I want to add a working new tab to EDD FES dashboard. (Tax info for authors)
I am able to add a new tab by editing your code above but how can I get it to work? When I click to my new tab it shows the dashboard tab content.
Thanks

@wooexpert
Copy link

Thanks for this Gist!
Now digging how to add content to our new tab.

@amitkolloldey
Copy link

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