Opened 13 years ago
Closed 13 years ago
#18812 closed defect (bug) (fixed)
XML-RPC newPost need more dashboard-like behavior for publishing posts
Reported by: | koke | Owned by: | josephscott |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | XML-RPC | Keywords: | has-patch mobile |
Focuses: | Cc: |
Description
Right now, metaWeblog.newPost calls wp_insert_post before:
- Attaching media uploads
- Set/unset sticky
- Set custom fields
- Set post formats
This is probably done since all those actions need the post ID, but it can break some plugins that rely on the publish_post action hook since the post is not complete at that point.
The idea is to make it behave more like wp-admin:
- Save the post as 'auto-draft'
- Attach uploads, set custom fields, ...
- Update with proper status
Attachments (4)
Change History (15)
#2
@
13 years ago
It'd be nice to do get_default_post_to_edit() then do a single wp_insert_post at the end.
#4
follow-up:
↓ 5
@
13 years ago
Is there a basic test case plugin that we can use to test the problem and potential solutions?
#5
in reply to:
↑ 4
@
13 years ago
Replying to josephscott:
Is there a basic test case plugin that we can use to test the problem and potential solutions?
The case I know is wordpress.com publicize, when publishing posts with images, the post in facebook doesn't have any of the images.
I guess any other facebook auto-publish plugin would have the same issue
#6
in reply to:
↑ 3
@
13 years ago
Replying to nacin:
Untested patch.
I tried this patch and it generated two of these PHP issues:
Warning: addslashes() expects parameter 1 to be string, object given in wp-includes/wp-db.php on line 783
I'm going to try out the orginal wp-18812.diff and see what happens there.
#7
@
13 years ago
Updated patch that I've tested using the Publicize feature on WPCOM and it appears to address the problem mentioned in the ticket. I'm soliciting a few more tests before giving this a full green light to commit to -trunk.
That said, this change is relatively small and looks like it shouldn't cause problems for other clients.
#8
@
13 years ago
After chatting with nacin about this, he found what was triggering the error with his patch. I've uploaded an updated version of his ( 18812.2.diff ).
Initial testing looks good.
Patch to set 'auto-draft' on metaWeblog.newPost until the post is complete