Skip to content

The author list for PostAuthor should be loaded on demand #27103

@johnbillion

Description

@johnbillion

Describe the bug

When loading the post editing screen, the <PostAuthor/> component triggers a REST API request (via getAuthors()) to fetch the authors to list to populate its filterable list. If the user isn't planning on changing the post author, this is an unnecessary REST API request and a waste of resources.

This request should be performed on-demand, for example when the field gains focus.

To reproduce

  1. Go to the post editing screen on a site with several users
  2. Observe that a request to wp-json/wp/v2/users is performed
  3. Don't change the post author
  4. Wonder why that request was needed

Editor version (please complete the following information):

  • WordPress version: 5.6 beta

Metadata

Metadata

Assignees

Labels

General InterfaceParts of the UI which don't fall neatly under other labels.[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions