Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Protozoan

    (@protozoan)

    Solved.

    Had a custom author drop down function that causes a large query loop.

    add_filter('wp_dropdown_users', 'cust_dropdown_users');
    function cust_dropdown_users($output)
    {
        $users = get_users();
    
        $output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">";
    
        //Leave the admin in the list
        $output .= "<option value=\"1\">Admin</option>";
        foreach ($users as $user) {
            $sel = ($GLOBALS['post']->post_author == $user->ID) ? "selected='selected'" : '';
            $output .= '<option value="' . $user->ID . '"' . $sel . '>' . $user->user_login . ' (' . $user->user_email . ')</option>';
        }
        $output .= "</select>";
    
        return $output;
    }

    Now trying to find a better way to select different authors (feel free to suggest!).

Viewing 1 replies (of 1 total)