WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#43367 closed defect (bug) (invalid)

Get post status translation issue on frontend

Reported by: sungraizfaryad Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

HI, Whenever i call get_post_status() on front-end then it is not translating because string are not returning with translation support as you can see here http://jmp.sh/GsrMqZs
BTW when i use get_post_statuses() then all status are translating properly on front-end.

Please look into it.

Thanks

Change History (1)

#1 @swissspidy
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This sounds correct to me. If you want to compare post statuses as a developer or store them somewhere, you can use get_post_status().

If you want to display the translated post status to the user, you can use something like this:

$statuses = get_post_statuses();

$statuses[ get_post_status() ];
Note: See TracTickets for help on using tickets.