Make WordPress Core

Opened 7 months ago

Closed 3 months ago

#59080 closed defect (bug) (wontfix)

confusing get_post_stati and get_post_statuses functions

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

Description (last modified by SergeyBiryukov)

maybe it is because i am not english, but i do not understand why we have 2 functions that seem to return very similar info
https://developer.wordpress.org/reference/functions/get_post_stati/
https://developer.wordpress.org/reference/functions/get_post_statuses/

imo get_post_stati fails the rule about descriptive function name

BTW imo all that statuses part should be rewritten for 6.4 and for the workflows to work
It is not possible now to simply register a new status as it does nothing to the UI (#55895), there are functions like get_page_statuses and get_post_statuses without some universal function for any post type etc.

Change History (4)

#1 @SergeyBiryukov
7 months ago

  • Component changed from General to Posts, Post Types
  • Description modified (diff)

Thanks for the ticket! Related/duplicate: #58134.

This ticket was mentioned in Slack in #core by jorbin. View the logs.


4 months ago

#3 @jorbin
4 months ago

  • Keywords close added
  • Version changed from trunk to 3.0

Related: #9674

It's too late to change the name of a function that was introduced in WP 3.0 (Also, updating the version to that).

While the names are similar, these two functions do different things. I think this should be closed as wontfix. As future changes happen to post statuses, likely in Gutenberg phase 3, naming should be considered but changing a name now would break many sites.

#4 @jorbin
3 months ago

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

Changing the name for something added 30+ major versions ago isn't feasible, so closing as wontfix

Note: See TracTickets for help on using tickets.