﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
21963	Consolidate post insertion APIs	nacin		"In wp-includes, we have:
 * wp_insert_post()
 * wp_insert_attachment()
 * wp_update_post()
 * wp_publish_post()

For saving from the admin, we have:
 * edit_post()
 * wp_write_post()
 * write_post()

'''wp_publish_post()''' is, as of [21942], now wraps wp_insert_post().

'''wp_update_post()''' is a fairly mundane wrapper of wp_insert_post(), but we really should eliminate the differences between the two functions and make it a straight-up wrapper.

'''wp_insert_attachment()''' was a fork of wp_insert_post(), and wp_insert_post() has gotten a lot of improvements that haven't reached wp_insert_attachment(). It doesn't take much to merge these two, though, and make wp_insert_attachment() a wrapper.

'''wp_write_post()''' calls edit_post() if it has a post ID. And since we have had a post ID since the days of auto-drafts, this function is dead code. It's wrapper, '''write_post()''', can also be deprecated.

I'm attaching a patch that takes care of wp_insert_post(), wp_write_post(), and write_post(). wp_update_post() will require a bit more concentration.

Needs testing and unit tests."	defect (bug)	new	normal	Future Release	Post Types		normal		has-patch needs-unit-tests 3.6-early	ocean90 scribu xoodrew@… sirzooro info@… kontakt@…
