[wp-trac] [WordPress Trac] #20547: Ability to define post attachment status on insertion
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 25 20:57:49 UTC 2012
#20547: Ability to define post attachment status on insertion
-------------------------+-----------------------------
Reporter: griffinjt | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.4
Severity: normal | Keywords: dev-feedback
-------------------------+-----------------------------
By default, `wp_insert_attachment` will either set a new attachment as
'inherited' or 'private' - inherited being that it simply mimics the post
status of its parent.
This is fine by default, but what about when wanting to run tests? For
example, you have a live post that you want to add attachments to, but you
want to ensure that the attachments (whatever they may be) are properly
formatted before making them appear on your live post. By default, just
uploading the attachment will push it live because it has inherited the
published status of its parent.
Is this doable? What about filtering `$object` in the `wp_parse_args`
function inside `wp_insert_attachment` to allow that property (along with
the others - it makes sense to be able to filter them all) to be set?
Don't know how feasible it is, but if it's possible I'll work on a patch
and tests.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20547>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list