[wp-hackers] Write a custom field to a new post via JS??

Matthew Gerring mgerring at emrl.com
Tue Jan 5 21:32:37 UTC 2010


Hello all. I have a serious brain twister I hope you all can help me solve.

I have an interface in the WordPress "add new post" screen, accessed via the media buttons. Basically what it's supposed to do is write an array to a custom field.

It works fine if you're editing a post- I can pass the array to PHP along with the post ID and use add_post_meta(). But I don't know how to do the same thing if you're creating a new post, since there's no post ID to add a custom field to.

Can anyone tell me how I would write metadata to a post that hasn't been published yet?

-Matthew




More information about the wp-hackers mailing list