1

When there are thousands of users registered in a website, the edit.php page will have performance issues.

if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
            $users_opt = array(
                'hide_if_only_one_author' => false,
                'who' => 'authors',
                'name' => 'post_author',
                'class'=> 'authors',
                'multi' => 1,
                'echo' => 0,
                'show' => 'display_name_with_login',
            );
            if ( $bulk )
                $users_opt['show_option_none'] = __( '— No Change —' );

            if ( $authors = wp_dropdown_users( $users_opt ) ) :
                $authors_dropdown  = '<label class="inline-edit-author">';
                $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
                $authors_dropdown .= $authors;
                $authors_dropdown .= '</label>';
            endif;
        endif; // authors

How can I remove the author list in the post edit page via functions.php file?

1

An easy sulotion will be to remove the post type author feature.

add_action( 'init', 'remove_cpt_author' );
function remove_cpt_author() {
    remove_post_type_support('post', 'author'); // this function require the post type and the feature you want to remove.
}
1
  • Thank you very much. This problem has troubled me for a long time. – user111527 Jan 23 '17 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.