Skip to content

Commit

Permalink
feat: add dokan_get_all_cap_labels function (#781)
Browse files Browse the repository at this point in the history
* feat: add dokan_get_translated_cap function

* refactor: rename dokan_get_translated_cap to dokan_get_all_cap_labels
  • Loading branch information
saimonh3 authored Mar 4, 2020
1 parent 6bc5d78 commit 14161ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2956,6 +2956,30 @@ function dokan_get_all_caps() {
return apply_filters( 'dokan_get_all_cap', $capabilities );
}

/**
* Get translated capability
*
* @since DOKAN_LITE_SINCE
*
* @param string $cap
*
* @return string
*/
function dokan_get_all_cap_labels( $cap ) {
$caps = apply_filters( 'dokan_get_all_cap_labels', [
'overview' => __( 'Overview', 'dokan-lite' ),
'report' => __( 'Report', 'dokan-lite' ),
'order' => __( 'Order', 'dokan-lite' ),
'coupon' => __( 'Coupon', 'dokan-lite' ),
'review' => __( 'Review', 'dokan-lite' ),
'withdraw' => __( 'Withdraw', 'dokan-lite' ),
'product' => __( 'Product', 'dokan-lite' ),
'menu' => __( 'Menu', 'dokan-lite' ),
] );

return ! empty( $caps[ $cap ] ) ? $caps[ $cap ] : '';
}

/**
* Merge user defined arguments into defaults array.
*
Expand Down

0 comments on commit 14161ab

Please sign in to comment.