• Resolved tdoccc

    (@tdoccc)


    Hi

    Having issues with frontend uploader. Using custom post types, my post keeps on being attributed to the same user (let’s call it TestUser1) each and every time. I’ve tried registering multiple test accounts to upload with different userroles too – seeing if the post will be attributed to these accounts but it’s still the same TestUser1 every time.

    Why is this? I’m using a custom form as well. I do not want the user to manually type their author name.

    The question in FAQ says

    How are authors determined?
    If someone is logged in, their user profile is automatically linked to the post

    thanks

    https://wordpress.org/plugins/frontend-uploader/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tdoccc

    (@tdoccc)

    Temporary fix.

    for function _upload_post()

    $author = isset( $_POST['post_author'] ) ? sanitize_text_field( $_POST['post_author'] ) : '';

    changes to

    $current_user = wp_get_current_user();
    
    		$author = $current_user->user_login;

    Works a charm.

    Plugin Author Rinat

    (@rinatkhaziev)

    Looks like a bug, thanks for flagging it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post keeps being attributed to one author ONLY (even if diff. user uploaded)’ is closed to new replies.