Opened 13 years ago
Last modified 3 months ago
#24722 assigned defect (bug)
get_post_statuses() and get_page_statuses() are hardcoded
| Reported by: | rmccue | Owned by: | chriscct7 |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Despite the support for registering custom post/page statuses in core, both get_post_statuses() and get_page_statuses() are hardcoded.
Both of these functions are only used in the XML-RPC API in core, however this may affect plugins.
(Somewhat related to the editorial-flow component, although that's on hiatus at the moment.)
Attachments (2)
Change History (12)
#1
follow-up:
↓ 3
@
13 years ago
Would it make sense to turn these into wrappers for get_post_stati()?
#2
@
13 years ago
See patch above. I didn't do the same thing for get_page_statuses() because it looked like from the code that page statuses are supposed to be a different list from post_statuses and currently there is no way to filter the post status by post_type because post type is NOT considered in registering post status.
#3
in reply to: ↑ 1
@
13 years ago
Replying to sillybean:
Would it make sense to turn these into wrappers for get_post_stati()?
No, because get_post_stati() return a filtered list of objects. right now get_post_statuses() returns an array indexed in status->name/status->label pairs and any client code using the function would expect the same. I still use the $wp_post_statuses global however, and created a helper function to spit out an array setup in the format using get_post_statuses() currently expects.
#7
@
13 years ago
Related: #12706 (ticket:12706:17, ticket:12706:48).
#8
@
11 years ago
- Keywords needs-refresh added; editorial-flow removed
- Milestone Future Release → 4.4
- Owner set to
- Severity minor → normal
- Status new → assigned
#9
@
11 years ago
- Milestone 4.4 → Future Release
24722.diff returns a map of non-internal statuses, but I'm not sure how useful this is. Without being able to associate object types to statuses, this is a very incomplete API.
This ticket was mentioned in PR #12067 on WordPress/wordpress-develop by @sainathpoojary.
3 months ago
#10
- Keywords needs-refresh removed
Trac ticket: #24722
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
make sure
get_post_statuses()includes registered post stati