UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post

Solved: There was different capitalization on the variable $key

($Key vs $key)

Always the simple things you miss eh? 🙂

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)