Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

hope someone can help.

I have my WP install configured to capture posts via a front-end form. Users do not log in, which is an explicit requirement. The author should be set based on a custom post field (by matchting the emailadress filled out in the form). Authors do have a profile already.

I found the wp_insert_post_data() function, assuming this could provide what I was looking for, and wrote a small plugin to set the author from default to submitter. However, it changes the post data before it is inserted into the database. Ergo: it can't set an author based on meta for a post that isn't inserted/doesn't exist yet. In effect, submitted posts don't have an author at all.

How can I work around this problem and automatically set the author of a post based on a custom field within that post after the post is created? I've been combing through the references/codex but couldn't recognize anything that could solve this.

Any suggestions? Hope so!

Best of luck & cheers,

-Pim

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.