codebykat / wp-post-by-email

Post By Email plugin for WordPress
GNU General Public License v2.0
31 stars 11 forks source link

Sets $post_author to 0 in stead of 1 if no author found #2

Closed barryceelen closed 11 years ago

barryceelen commented 11 years ago

The user is set to 1 when a user with a corresponding $from_email is not found. A user with that ID might not exist. Setting it to 0 prevents a php notice when calling wp_dropdown_users(), eg. in the 'Author' meta box.

codebykat commented 11 years ago

Thanks! It was actually pointed out to me elsewhere that the user with an ID of 1 is not always the admin user. I've changed this to a function that looks at the capabilities in the database and returns a valid admin user... I think in the long-term it might need to be a setting, since there could be multiple admins. And in fact, any user with publish_posts capability would be a valid choice for this. Anyhow, last night's update should fix the issue with wp_dropdown_users().