Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Dashboard Status Translation Issue #2215

Merged
merged 8 commits into from
Feb 4, 2025
Rate limit · GitHub

Whoa there!

You have triggered an abuse detection mechanism.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

Merged
Changes from 1 commit
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
Next Next commit
dynamic status name
Rate limit · GitHub

Whoa there!

You have triggered an abuse detection mechanism.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

HeyMehedi committed Jan 26, 2025
commit 1ece6fb2adbdca6f554302b9a9fd8a83de1c89f7
6 changes: 4 additions & 2 deletions includes/model/ListingDashboard.php
Original file line number Diff line number Diff line change
@@ -172,8 +172,10 @@ public function listing_pagination( $base = '', $paged = '' ) {

public function get_listing_status_html() {
$id = get_the_ID();
$status_label = get_post_status_object( get_post_status( $id ) )->label;
$html = sprintf('<span class="directorist_badge dashboard-badge directorist_status_%s">%s</span>', strtolower($status_label), $status_label );
$status = get_post_status( $id );
$statuses = get_post_statuses();
$status_label = $statuses[$status] ?? __( 'Unknown', 'directorist' );
$html = sprintf('<span class="directorist_badge dashboard-badge directorist_status_%s">%s</span>', strtolower( $status ), $status_label );
return $html;
}