Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#43367 closed defect (bug) (invalid)

Get post status translation issue on frontend

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


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
BTW when i use get_post_statuses() then all status are translating properly on front-end.

Please look into it.


Change History (1)

#1 @swissspidy
6 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.