post meta - Filter for author list in gutenberg core editor

Is there a filter to modify the presentation of certain editor editor components?For my example, I want to be able to

Is there a filter to modify the presentation of certain editor editor components? For my example, I want to be able to filter the author list which is a select input in the Gutenberg editor on the document pane.

I know the component I want to modify is located here: .js

Is there a filter to modify the presentation of certain editor editor components? For my example, I want to be able to filter the author list which is a select input in the Gutenberg editor on the document pane.

I know the component I want to modify is located here: https://github/WordPress/gutenberg/blob/8517779feddf3de0b86465fae8f21f4384447c58/packages/editor/src/components/post-author/index.js

Share Improve this question asked Sep 6, 2019 at 23:58 Jim SchofieldJim Schofield 11 bronze badge 2
  • Which functionality you want to add? – BenB Commented Sep 7, 2019 at 1:44
  • I want to be able to show more properties from the user object than just the pretty name. We have a case where we have multiple username slugs with the same pretty name, and so we need to show both in the select box – Jim Schofield Commented Sep 9, 2019 at 0:05
Add a comment  | 

1 Answer 1

Reset to default 1

The component post-author uses getAuthors() to get the authors, this functions calls the REST API.

export function* getAuthors() {
    const users = yield apiFetch( { path: '/wp/v2/users/?who=authors&per_page=-1' } );
    yield receiveUserQuery( 'authors', users );
}

So you can only filter via the REST API filter rest_user_query, but this can have effects on other plugins which also use this endpoint to get the user list.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745178642a4615315.html

相关推荐

  • post meta - Filter for author list in gutenberg core editor

    Is there a filter to modify the presentation of certain editor editor components?For my example, I want to be able to

    11小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信