• The function below used to work great until WP5+ to assign any WP user as an author of a post.

    add_filter( 'wp_dropdown_users_args', 'add_subscribers_to_dropdown', 10, 2 );
    function add_subscribers_to_dropdown( $query_args, $r ) {
        $query_args['who'] = '';
        return $query_args;
    }

    I can’t find in the docs what’s changed that made this stop working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Something related to the new block editor functionality. FWIW, your code still works in quick edit mode. The block editor apparently does not use wp_dropdown_users() since your code still works with that function.

    Once we know where the new drop down is implemented, we can determine if and how we can alter the list. It’s no longer its own meta box, it’s rolled into a status side panel. It appears to be part of the editor’s JavaScript code: wp-includes/js/dist/editor.js. It makes a call to method .getAuthors() (line 24635), but I have not found where that method is declared.

    Thread Starter omarfilip

    (@omarfilip)

    Thanks for the quick edit mode tip – it didn’t occur to me to check there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change author to any subscriber no longer works after WP 5+’ is closed to new replies.