Support » Fixing WordPress » users missing from author dropdown after upgrade

  • 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?

Viewing 15 replies - 1 through 15 (of 19 total)
  • 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.

    kilwag

    (@kilwag)

    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.

    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.

    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?

    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.

    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.

    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;
    }

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

    @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;

    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

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

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

    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.

    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.

    @ 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?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘users missing from author dropdown after upgrade’ is closed to new replies.