Opened 17 years ago
Closed 17 years ago
#5569 closed enhancement (fixed)
Manage post_status via XML-RPC
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
The post_status field is now exposed via XML-RPC methods, we need a way to set it as well. To that end this ticket addresses the following items:
- Hide the 'future' post_status from posts, expose them as 'publish' instead
- Look for a 'post_status' field in metaWeblog.newPost and metaWeblog.editPost and use it, overriding the publish argument
- Add new wp.getPostStatusList and wp.getPageStatusList methods
The future post_status is an internal status only, so to make sure that clients don't get confused by posts that have a status of 'future' by sending it as published. This matches what a user would see for a future post in wp-admin.
If we find a 'post_status' field in metaWeblog.newPost or metaWeblog.editPost then check that has a value of 'draft', 'private', 'publish', 'pending' and if so then override the publish argument with the value in the 'post_status' field. We do the same thing for pages, with the exception that 'pending' isn't a valid status for a page.
Clients need a way to know what the valid statuses are for posts and pages, so wp.getPostStatusList and wp.getPageStatusList each return an array, with each item in the array being a valid post_status.
Attachments (5)
Change History (13)
#2
@
17 years ago
I've updated the patch to make use of two new core functions, get_post_statuses() and get_page_statuses(). In addition I've updated the wp-admin write post and write page forms to make use of these functions as well, instead of hard coding the values as they were before.
I did not add filtering abilities of post/page statuses because right now the post_status field in database is an ENUM, so it currently won't accept any other values that what the schema defines. If/when that is changed then we could add filtering features.
#3
follow-up:
↓ 4
@
17 years ago
Since wp-admin is still in state of flux can we commit just the xmlrpc.php and post.php diffs?
#4
in reply to:
↑ 3
@
17 years ago
Replying to josephscott:
Since wp-admin is still in state of flux can we commit just the xmlrpc.php and post.php diffs?
We can.
However at present the combination of these patches plus the ones for the admin pages will not translate correctly.
You can only pass strings to __('')
and friends not variables.
#6
@
17 years ago
While testing this after it was committed I realized that setting status for pages would end up being done by a field called post_status, which didn't make much sense because the status for pages was being exposed as page_status in other methods. The new xmlrpc.php.2.diff makes use of the post_type to determine if we need to look at post_status or page_status when setting the status value when creating and editing posts and pages.
Looks good.
Comments: