Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Function Reference/wp insert attachment

Good related material?

Is this example an improvement to the one on this page? If so, should we add a resources section with a link?

cyberhobo 20:30, 27 July 2010 (UTC)


I think so, but of course I'm a bit biased :) ... This is a much lower level of the Media API than Function_Reference/media_handle_upload, so that link would do better there. I'd like to see this page worked out a little better for user who need to use the low-level API, though. 03:38, 22 May 2012 (UTC)


I've just cleaned up the example a little bit. I've also added a link to media_handle_upload() in the description.
-Jdgrimes 19:32, 25 March 2014 (UTC)

GUID

I added the 'guid' to the attachment array. Without it, the guid was empty and in the media library File name: was a blank entry.

Beer 07:21, 25 February 2012 (UTC)