Permalink
Browse files

Guest Authors: When the user_login value for the guest author and the…

… linked_account values are the same, don't let the linked_account value get nooped

On the UI side, the 'select' dropdown is disabled which means $_POST isn't properly set
  • Loading branch information...
1 parent 5167df7 commit 64b3624021a0b2f3ba6189f7c7a2f7d49ce6e98b @danielbachhuber danielbachhuber committed Nov 11, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 php/class-coauthors-guest-authors.php
@@ -635,7 +635,10 @@ function manage_guest_author_save_meta_fields( $post_id, $post ) {
}
if ( 'linked_account' == $author_field['key'] ) {
$linked_account_key = $this->get_post_meta_key( 'linked_account' );
- $user_id = ( isset( $_POST[$linked_account_key] ) ) ? intval( $_POST[$linked_account_key] ) : 0;
+ if ( ! empty( $_POST[$linked_account_key] ) )
+ $user_id = intval( $_POST[$linked_account_key] );
+ else
+ continue;
$user = get_user_by( 'id', $user_id );
if ( $user_id > 0 && is_object( $user ) )
$user_login = $user->user_login;

0 comments on commit 64b3624

Please sign in to comment.