Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/src/less/global-admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,14 @@
padding-bottom: 0.5rem;
font-size: 13px;
}

/**
* Keep the Dokan admin menu pending-count badges readable in every state.
*/
#adminmenu #toplevel_page_dokan .wp-submenu .awaiting-mod,
#adminmenu #toplevel_page_dokan .wp-submenu li a:hover .awaiting-mod,
#adminmenu #toplevel_page_dokan .wp-submenu li a:focus .awaiting-mod,
#adminmenu #toplevel_page_dokan .wp-submenu li.current a .awaiting-mod {
background-color: #3858e9;
color: #fff;
}
13 changes: 12 additions & 1 deletion includes/Admin/Dashboard/Pages/Vendors.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ public function get_id(): string {
}

public function menu( string $capability, string $position ): array {
$status_count = dokan_get_seller_status_count();
$pending_count = absint( $status_count['inactive'] ?? 0 );

$menu_title = $pending_count ? sprintf(
/* translators: %s: Inactive vendor count badge */
__( 'Vendors %s', 'dokan-lite' ),
'<span class="awaiting-mod count-1"><span class="pending-count">'
. number_format_i18n( $pending_count )
. '</span></span>'
) : __( 'Vendors', 'dokan-lite' );

return [
'page_title' => __( 'Vendors', 'dokan-lite' ),
'menu_title' => __( 'Vendors', 'dokan-lite' ),
'menu_title' => $menu_title,
'route' => 'vendors',
'capability' => $capability,
'position' => 100,
Expand Down
13 changes: 12 additions & 1 deletion includes/Admin/Dashboard/Pages/Withdraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ public function get_id(): string {
* @inheritDoc
*/
public function menu( string $capability, string $position ): array {
$withdraw_count = dokan_get_withdraw_count();
$pending_count = absint( $withdraw_count['pending'] ?? 0 );

$menu_title = $pending_count ? sprintf(
/* translators: %s: Pending withdraw request count badge */
__( 'Withdraw %s', 'dokan-lite' ),
'<span class="awaiting-mod count-1"><span class="pending-count">'
. number_format_i18n( $pending_count )
. '</span></span>'
) : __( 'Withdraw', 'dokan-lite' );

return [
'page_title' => __( 'Withdraw Management', 'dokan-lite' ),
'menu_title' => __( 'Withdraw', 'dokan-lite' ),
'menu_title' => $menu_title,
'route' => 'withdraw',
'capability' => $capability,
'position' => 10,
Expand Down
Loading