WordPress.org

Ready to get started?Download WordPress

Forums

users missing from author dropdown after upgrade (20 posts)

  1. newswriter
    Member
    Posted 3 years ago #

    Only some users show up in my author dropdown on post pages. All the users show up in the user list -- but I can only select from the handful that actually populate the drop down box, unless I want to go create a whole new user. Any ideas?

  2. Hamster69
    Member
    Posted 3 years ago #

    Having the same issue. Most users are in the dropdown, but a few aren't. All have the same role, so not sure why some are excluded, or how to fix.

  3. kilwag
    Member
    Posted 3 years ago #

    Me, too, but oddly enough only on one of my network sites. All the users have disappeared. I can add new ones but they disappear as soon as I add them. Adding preexisting users tells me that user already exists, even though they don't show up in the users table for that site's dashboard. The users still show up in Network Admin though. I tried enabling Twenty Ten to see if it was an error caused by my theme but it didn't help. It's distressing.

  4. Hamster69
    Member
    Posted 3 years ago #

    I have this problem too. If I change the roles of the missing users to "Author," they show up in the dropdown correctly. If I change the role to "Contributor," they do not show up in the dropdown. This only happens for users added after the 3.1 upgrade.

  5. jasontremblay
    Member
    Posted 3 years ago #

    I'm having the same problem. Same set of users, same roles. They all appear in the drop-down on one of my multisite blogs, but most are missing from the other. Anyone have any insight into this?

  6. ericleeclark
    Member
    Posted 3 years ago #

    Try reseting the role for your user(s) in the admin. If you are the administrator, you will need to log in as another admin user to change your role. I logged in, changed the role on my normal admin user to something other than administrator, saved it, and then changed it back to administrator. I also did this for a few other users, but not all. I actually noticed all the other users no longer had this issue once we updated a few of our users... basically forced the database to correct itself. Must be a small bug in the upgrade.

    Hope this helps.

  7. kilwag
    Member
    Posted 3 years ago #

    I got tired of it so I exported the offending network site and reimported it as another site. The new one worked, so I trashed the old one. Kind of a drastic step, but it ultimately worked.

  8. jasontremblay
    Member
    Posted 3 years ago #

    I decided it was impractical to try to solve this through the admin... who knows if the problem would recur for every blog I add, and I'd have annoying busy work to do over and over. Instead, I just added a filter to my functions.php to include all users (not just Authors).

    // Filter to fix the Post Author Dropdown
    add_filter('wp_dropdown_users', 'theme_post_author_override');
    function theme_post_author_override($output)
    {
      // return if this isn't the theme author override dropdown
      if (!preg_match('/post_author_override/', $output)) return $output;
    
      // return if we've already replaced the list (end recursion)
      if (preg_match ('/post_author_override_replaced/', $output)) return $output;
    
      // replacement call to wp_dropdown_users
    	$output = wp_dropdown_users(array(
    	  'echo' => 0,
    		'name' => 'post_author_override_replaced',
    		'selected' => empty($post->ID) ? $user_ID : $post->post_author,
    		'include_selected' => true
    	));
    
    	// put the original name back
    	$output = preg_replace('/post_author_override_replaced/', 'post_author_override', $output);
    
      return $output;
    }
  9. scottbothel
    Member
    Posted 2 years ago #

    Oh thank you for the workaround! My head feels better now.

  10. jasontremblay
    Member
    Posted 2 years ago #

    @scottbothel... you also need to add this line to the beginning of the theme_post_author_override function I posted above:

    global $post, $user_ID;

  11. Nick Davis
    Member
    Posted 2 years ago #

    Hi Jason

    Thanks so much for the code, it worked for me on the Edit Post screen

    Do you know how I might achieve the same with the Author dropdown in Quick Edit though?

    Appreciate any advice you can give

    Thanks

    Nick

  12. jasontremblay
    Member
    Posted 2 years ago #

    @Nickyboy, sorry I've never used the Quick Edit, so I'm not familiar with that code.

  13. Nick Davis
    Member
    Posted 2 years ago #

    Hey Jason, thanks for the quick reply, much appreciated anyway, Nick

  14. allmyhoney
    Member
    Posted 2 years ago #

    Is there any other fix for this? or does anyone else know if this will be fixed in coming release? I to have this issue.

  15. allmyhoney
    Member
    Posted 2 years ago #

    I have posted this fix in the theme functions.php of my multi-site and it did not seem to work for me. Any other ideas? much appreciated.

  16. zyrq
    Member
    Posted 2 years ago #

    @ jasontremblay, thanks for posting this workaround!

    Do you have any pointers how to list only those users with the role(s) with the cap to write/edit post or page, for example only Author role?

  17. drokkon
    Member
    Posted 2 years ago #

    Shoot...sorry I just started a new thread on this before searching. :(

    I've got the same problem...any fix on the horizon?

  18. drokkon
    Member
    Posted 2 years ago #

    @jasontremblay Thanks, but your function was a no-go for me! I think it's because the user I'm missing has disappeared from the blog entirely. Network admin reassures me that he's an admin on the particular blog, but he doesn't show up under users on that blog OR on the author dropdown. I've deleted and readded him to the blog, but no go. :(

  19. drokkon
    Member
    Posted 2 years ago #

    In case anyone is looking for a resolution to this problem, in MY case it was the "My Custom Widgets" plugin. Whether activated network-wide or just on the site, it produced this strange "disappearing user" behavior.

    http://wordpress.org/support/topic/user-disappeared-from-site-cannot-add-back

  20. eteich
    Member
    Posted 2 years ago #

    Any way to get this to not change the post author everytime you edit it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.